From 74be3091ffc0d2fc4d4050d9524519e848d0868c Mon Sep 17 00:00:00 2001 From: jonjohnsonjr Date: Thu, 13 Jan 2022 08:15:49 -0800 Subject: [PATCH] Fix pusher flags for --config and --tarball (#1998) --- container/go/cmd/pusher/pusher.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/container/go/cmd/pusher/pusher.go b/container/go/cmd/pusher/pusher.go index 4fac73ccb..5d553b042 100644 --- a/container/go/cmd/pusher/pusher.go +++ b/container/go/cmd/pusher/pusher.go @@ -38,8 +38,8 @@ import ( var ( dst = flag.String("dst", "", "The destination location including repo and digest/tag of the docker image to push. Supports fully-qualified tag or digest references.") - imgTarball = flag.String("tarball", "", "Path to the image tarball as generated by docker save.") - imgConfig = flag.String("config", "", "Path to the image config.json. Required when --format is Docker.") + imgTarball = flag.String("tarball", "", "Path to the image tarball as generated by docker save. Required if --config was not specified.") + imgConfig = flag.String("config", "", "Path to the image config.json. Required if --tarball was not specified.") baseManifest = flag.String("manifest", "", "Path to the manifest of the base image. This should be the very first image in the chain of images and is only really required for windows images with a base image that has foreign layers.") format = flag.String("format", "", "The format of the uploaded image (Docker or OCI).") clientConfigDir = flag.String("client-config-dir", "", "The path to the directory where the client configuration files are located. Overiddes the value from DOCKER_CONFIG.") @@ -81,8 +81,8 @@ func main() { if *format == "" { log.Fatalln("Required option -format was not specified.") } - if *imgConfig == "" { - log.Fatalln("Option --config is required.") + if *imgTarball == "" && *imgConfig == "" { + log.Fatalln("Neither --tarball nor --config was specified.") } // If the user provided a client config directory, ensure it's a valid