diff --git a/cli/command_snapshot.go b/cli/command_snapshot.go index 88daa043a..d571e5677 100644 --- a/cli/command_snapshot.go +++ b/cli/command_snapshot.go @@ -8,7 +8,6 @@ type commandSnapshot struct { estimate commandSnapshotEstimate expire commandSnapshotExpire fix commandSnapshotFix - gc commandSnapshotGC list commandSnapshotList migrate commandSnapshotMigrate pin commandSnapshotPin @@ -25,7 +24,6 @@ func (c *commandSnapshot) setup(svc advancedAppServices, parent commandParent) { c.estimate.setup(svc, cmd) c.expire.setup(svc, cmd) c.fix.setup(svc, cmd) - c.gc.setup(svc, cmd) c.list.setup(svc, cmd) c.migrate.setup(svc, cmd) c.pin.setup(svc, cmd) diff --git a/cli/command_snapshot_gc.go b/cli/command_snapshot_gc.go deleted file mode 100644 index a9e98bc3d..000000000 --- a/cli/command_snapshot_gc.go +++ /dev/null @@ -1,16 +0,0 @@ -package cli - -import ( - "github.com/kopia/kopia/repo/maintenance" -) - -type commandSnapshotGC struct { - snapshotGCDelete bool - snapshotGCSafety maintenance.SafetyParameters -} - -func (c *commandSnapshotGC) setup(_ appServices, parent commandParent) { - cmd := parent.Command("gc", "DEPRECATED: This command does not do anything and will be removed. Snapshot GC is now automatically done as part of repository maintenance.").Hidden() - cmd.Flag("delete", "Delete unreferenced contents").BoolVar(&c.snapshotGCDelete) - safetyFlagVar(cmd, &c.snapshotGCSafety) -} diff --git a/tests/end_to_end_test/snapshot_delete_test.go b/tests/end_to_end_test/snapshot_delete_test.go index 64b7cfd0c..0af2034c8 100644 --- a/tests/end_to_end_test/snapshot_delete_test.go +++ b/tests/end_to_end_test/snapshot_delete_test.go @@ -230,7 +230,7 @@ func TestSnapshotDeleteRestore(t *testing.T) { e.RunAndExpectFailure(t, "snapshot", "delete", snapID, "--delete") // garbage-collect to clean up the root object. - e.RunAndExpectSuccess(t, "snapshot", "gc", "--delete", "--safety=none") + e.RunAndExpectSuccess(t, "maintenance", "run", "--full") // Run a restore on the deleted snapshot's root ID. The root should be // marked as deleted but still recoverable diff --git a/tests/endurance_test/endurance_test.go b/tests/endurance_test/endurance_test.go index 58a815b50..566cfc18e 100644 --- a/tests/endurance_test/endurance_test.go +++ b/tests/endurance_test/endurance_test.go @@ -274,7 +274,7 @@ func enduranceRunner(t *testing.T, runnerID int, fakeTimeServer, webdavServer st e.RunAndExpectSuccess(t, "repo", "connect", "webdav", "--url", webdavServer, "--override-username="+fmt.Sprintf("runner-%v", runnerID)) if runnerID == 0 { - e.RunAndExpectSuccess(t, "gc", "set", "--enable-full=true", "--full-interval=4h", "--owner=me") + e.RunAndExpectSuccess(t, "maintenance", "set", "--enable-full=true", "--full-interval=4h", "--owner=me") } var s runnerState diff --git a/tests/tools/kopiarunner/kopia_snapshotter.go b/tests/tools/kopiarunner/kopia_snapshotter.go index 5648bb1fd..dbc21ff8a 100644 --- a/tests/tools/kopiarunner/kopia_snapshotter.go +++ b/tests/tools/kopiarunner/kopia_snapshotter.go @@ -160,7 +160,7 @@ func (ks *KopiaSnapshotter) DeleteSnapshot(snapID string) (err error) { // RunGC implements the Snapshotter interface, issues a gc command to the kopia repo. func (ks *KopiaSnapshotter) RunGC() (err error) { - _, _, err = ks.Runner.Run("snapshot", "gc") + _, _, err = ks.Runner.Run("maintenance", "run", "--full") return err }