diff --git a/cmd/cmd.go b/cmd/cmd.go index b70b43e..d7d167f 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -34,7 +34,7 @@ func NewCleanupCommand(build Build) *cobra.Command { cmds.PersistentFlags().StringVarP(&o.LogLevel, "verbosity", "v", "info", "Log level to use") - cmds.AddCommand(NewTagsCommand()) + cmds.AddCommand( cmds.AddCommand(NewImageStreamCleanupCommand()) return cmds diff --git a/cmd/docker.go b/cmd/docker.go deleted file mode 100644 index 19bf090..0000000 --- a/cmd/docker.go +++ /dev/null @@ -1,32 +0,0 @@ -package cmd - -import ( - "github.com/appuio/image-cleanup/pkg/docker" - "github.com/spf13/cobra" - - log "github.com/sirupsen/logrus" -) - -// NewTagsCommand creates a cobra command to print the tags of a docker image -func NewTagsCommand() *cobra.Command { - cmd := &cobra.Command{ - Use: "tags", - Short: "Print the available tags", - Long: `Print the available tags for a Docker image`, - Args: cobra.ExactValidArgs(1), - Run: printImageTags, - } - - return cmd -} - -func printImageTags(cmd *cobra.Command, args []string) { - image := args[0] - - imageTags, err := docker.GetImageTags(image) - if err != nil { - log.WithError(err).WithField("image", image).Fatal("Retrieving image tags failed.") - } - - log.Println(imageTags) -}