diff --git a/release/build/main.go b/release/build/main.go index 76034008284..3a0e04fb7c2 100644 --- a/release/build/main.go +++ b/release/build/main.go @@ -25,6 +25,7 @@ import ( "gopkg.in/natefinch/lumberjack.v2" "github.com/projectcalico/calico/release/internal/config" + "github.com/projectcalico/calico/release/internal/hashreleaseserver" "github.com/projectcalico/calico/release/internal/outputs" "github.com/projectcalico/calico/release/internal/pinnedversion" "github.com/projectcalico/calico/release/internal/registry" @@ -336,8 +337,7 @@ func hashreleaseSubCommands(cfg *config.Config) []*cli.Command { Aliases: []string{"gc"}, Action: func(c *cli.Context) error { configureLogging("hashrelease-garbage-collect.log") - tasks.HashreleaseCleanRemote(cfg) - return nil + return hashreleaseserver.CleanOldHashreleases(&cfg.HashreleaseServerConfig) }, }, } diff --git a/release/pkg/tasks/hashrelease.go b/release/pkg/tasks/hashrelease.go index d27b4d48611..cd271c0e092 100644 --- a/release/pkg/tasks/hashrelease.go +++ b/release/pkg/tasks/hashrelease.go @@ -214,14 +214,6 @@ func HashreleasePush(cfg *config.Config, path string, setLatest bool) { }).Info("Published hashrelease") } -// HashreleaseCleanRemote cleans up old hashreleases on the docs host -func HashreleaseCleanRemote(cfg *config.Config) { - logrus.Info("Cleaning up old hashreleases") - if err := hashreleaseserver.CleanOldHashreleases(&cfg.HashreleaseServerConfig); err != nil { - logrus.WithError(err).Fatal("Failed to delete old hashreleases") - } -} - // ReformatHashrelease modifies the generated release output to match // the "legacy" format our CI tooling expects. This should be temporary until // we can update the tooling to expect the new format.