Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Commit

Permalink
Fix pusher flags for --config and --tarball
Browse files Browse the repository at this point in the history
This was done for the digester in #1721 but not the pusher. This change
makes them consistent again.
  • Loading branch information
jonjohnsonjr committed Jan 12, 2022
1 parent 40d4036 commit 7eb1dc0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions container/go/cmd/pusher/pusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down Expand Up @@ -81,8 +81,11 @@ 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 *imgTarball != "" && *imgConfig != "" {
log.Fatalf("Both --tarball=%q & --config=%q were specified. Only one of them must be specified.", *imgTarball, *imgConfig)
}

// If the user provided a client config directory, ensure it's a valid
Expand Down

0 comments on commit 7eb1dc0

Please sign in to comment.