From 3686b654260618d19b621453471cdfce5b9e8f66 Mon Sep 17 00:00:00 2001 From: Gijs Date: Sat, 11 May 2019 15:14:25 +0200 Subject: [PATCH] Process feedback of priyawadhwa regarding naming/nilcheck. Changes the argument flag from `--digestfile` to `--digest-file`. Skips an unneeded nil check. --- cmd/executor/cmd/root.go | 2 +- pkg/executor/push.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/executor/cmd/root.go b/cmd/executor/cmd/root.go index a3a59511b..1fc2672bc 100644 --- a/cmd/executor/cmd/root.go +++ b/cmd/executor/cmd/root.go @@ -128,7 +128,7 @@ func addKanikoOptionsFlags(cmd *cobra.Command) { RootCmd.PersistentFlags().BoolVarP(&opts.NoPush, "no-push", "", false, "Do not push the image to the registry") RootCmd.PersistentFlags().StringVarP(&opts.CacheRepo, "cache-repo", "", "", "Specify a repository to use as a cache, otherwise one will be inferred from the destination provided") RootCmd.PersistentFlags().StringVarP(&opts.CacheDir, "cache-dir", "", "/cache", "Specify a local directory to use as a cache.") - RootCmd.PersistentFlags().StringVarP(&opts.DigestFile, "digestfile", "", "", "Specify a file to save the digest of the built image to.") + RootCmd.PersistentFlags().StringVarP(&opts.DigestFile, "digest-file", "", "", "Specify a file to save the digest of the built image to.") RootCmd.PersistentFlags().BoolVarP(&opts.Cache, "cache", "", false, "Use cache when building image") RootCmd.PersistentFlags().BoolVarP(&opts.Cleanup, "cleanup", "", false, "Clean the filesystem at the end") RootCmd.PersistentFlags().DurationVarP(&opts.CacheTTL, "cache-ttl", "", time.Hour*336, "Cache timeout in hours. Defaults to two weeks.") diff --git a/pkg/executor/push.go b/pkg/executor/push.go index 628982c95..a02d5b9b9 100644 --- a/pkg/executor/push.go +++ b/pkg/executor/push.go @@ -76,7 +76,7 @@ func CheckPushPermissions(opts *config.KanikoOptions) error { func DoPush(image v1.Image, opts *config.KanikoOptions) error { t := timing.Start("Total Push Time") - if image != nil && opts.DigestFile != "" { + if opts.DigestFile != "" { digest, err := image.Digest() if err != nil { return errors.Wrap(err, "error fetching digest")