summaryrefslogtreecommitdiff
path: root/cmd/podman/images/push.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-04-29 14:14:02 +0200
committerValentin Rothberg <rothberg@redhat.com>2020-04-29 14:14:02 +0200
commit46b185942ce6297a3e59a048790649571676818b (patch)
tree06196a142c8a258b833058c1270d946a3eb7845f /cmd/podman/images/push.go
parent854293a59ae9fcf78e539f84ef1ebf7952ef925f (diff)
downloadpodman-46b185942ce6297a3e59a048790649571676818b.tar.gz
podman-46b185942ce6297a3e59a048790649571676818b.tar.bz2
podman-46b185942ce6297a3e59a048790649571676818b.zip
push: simplify cmd
The indirection via a 2nd variable isn't needed. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'cmd/podman/images/push.go')
-rw-r--r--cmd/podman/images/push.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/cmd/podman/images/push.go b/cmd/podman/images/push.go
index 92a08255c..d6bebb026 100644
--- a/cmd/podman/images/push.go
+++ b/cmd/podman/images/push.go
@@ -108,22 +108,21 @@ func imagePush(cmd *cobra.Command, args []string) error {
return errors.New("push requires at least one image name, or optionally a second to specify a different destination")
}
- pushOptsAPI := pushOptions.ImagePushOptions
// TLS verification in c/image is controlled via a `types.OptionalBool`
// which allows for distinguishing among set-true, set-false, unspecified
// which is important to implement a sane way of dealing with defaults of
// boolean CLI flags.
if cmd.Flags().Changed("tls-verify") {
- pushOptsAPI.TLSVerify = types.NewOptionalBool(pushOptions.TLSVerifyCLI)
+ pushOptions.TLSVerify = types.NewOptionalBool(pushOptions.TLSVerifyCLI)
}
- if pushOptsAPI.Authfile != "" {
- if _, err := os.Stat(pushOptsAPI.Authfile); err != nil {
- return errors.Wrapf(err, "error getting authfile %s", pushOptsAPI.Authfile)
+ if pushOptions.Authfile != "" {
+ if _, err := os.Stat(pushOptions.Authfile); err != nil {
+ return errors.Wrapf(err, "error getting authfile %s", pushOptions.Authfile)
}
}
// Let's do all the remaining Yoga in the API to prevent us from scattering
// logic across (too) many parts of the code.
- return registry.ImageEngine().Push(registry.GetContext(), source, destination, pushOptsAPI)
+ return registry.ImageEngine().Push(registry.GetContext(), source, destination, pushOptions.ImagePushOptions)
}