feat(snapshots): Implement volume shadow copy support on Windows (#3543)

* Implement volume shadow copy support on Windows

* Update go-vss version

* Fix unused variables

* Rename upload_actions*.go files

* Move vss settings to a separate policy section

* Handle existing shadow copy root

* Fix tests

* Fix lint issues

* Add cli policy test

* Add OS snapshot integration test

* Add GitHub Actions VSS test

* Fix "Incorrect function" error for root VSS snapshots

* Rename err to finalErr in createOSSnapshot

* Add OSSnapshotMode test

* Do not modify paths starting with \\?\ on Windows

* Allow warning messages in logfile tests

* Fix ignorefs not wrapping OS snapshot directory

* Retry VSS creation if another op was in progress

---------

Co-authored-by: Jarek Kowalski <jaak@jkowalski.net>
This commit is contained in:
Maxim Khitrov
2024-02-04 00:44:41 -05:00
committed by GitHub
parent 3fed193051
commit f62ef51700
23 changed files with 528 additions and 22 deletions

View File

@@ -24,6 +24,7 @@ type commandPolicySet struct {
policyLoggingFlags
policyRetentionFlags
policySchedulingFlags
policyOSSnapshotFlags
policyUploadFlags
}
@@ -39,6 +40,7 @@ func (c *commandPolicySet) setup(svc appServices, parent commandParent) {
c.policyLoggingFlags.setup(cmd)
c.policyRetentionFlags.setup(cmd)
c.policySchedulingFlags.setup(cmd)
c.policyOSSnapshotFlags.setup(cmd)
c.policyUploadFlags.setup(cmd)
cmd.Action(svc.repositoryWriterAction(c.run))
@@ -112,6 +114,10 @@ func (c *commandPolicySet) setPolicyFromFlags(ctx context.Context, p *policy.Pol
return errors.Wrap(err, "actions policy")
}
if err := c.setOSSnapshotPolicyFromFlags(ctx, &p.OSSnapshotPolicy, changeCount); err != nil {
return errors.Wrap(err, "OS snapshot policy")
}
if err := c.setLoggingPolicyFromFlags(ctx, &p.LoggingPolicy, changeCount); err != nil {
return errors.Wrap(err, "actions policy")
}