mirror of
https://github.com/containers/skopeo.git
synced 2025-09-17 15:30:38 +00:00
Migrate --*daemon-host to imageOptions
This was previously only supported in (skopeo copy). Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
@@ -98,16 +98,6 @@ func copyCmd(global *globalOptions) cli.Command {
|
||||
Name: "dest-compress",
|
||||
Usage: "Compress tarball image layers when saving to directory using the 'dir' transport. (default is same compression type as source)",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "src-daemon-host",
|
||||
Value: "",
|
||||
Usage: "use docker daemon host at `HOST` (docker-daemon sources only)",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "dest-daemon-host",
|
||||
Value: "",
|
||||
Usage: "use docker daemon host at `HOST` (docker-daemon destinations only)",
|
||||
},
|
||||
}, srcFlags...), destFlags...),
|
||||
}
|
||||
}
|
||||
|
@@ -19,6 +19,7 @@ type imageOptions struct {
|
||||
dockerCertPath string // A directory using Docker-like *.{crt,cert,key} files for connecting to a registry or a daemon
|
||||
tlsVerify optionalBool // Require HTTPS and verify certificates (for docker: and docker-daemon:)
|
||||
sharedBlobDir string // A directory to use for OCI blobs, shared across repositories
|
||||
dockerDaemonHost string // docker-daemon: host to connect to
|
||||
}
|
||||
|
||||
// imageFlags prepares a collection of CLI flags writing into imageOptions, and the managed imageOptions structure.
|
||||
@@ -56,6 +57,11 @@ func imageFlags(global *globalOptions, flagPrefix, credsOptionAlias string) ([]c
|
||||
Usage: "`DIRECTORY` to use to share blobs across OCI repositories",
|
||||
Destination: &opts.sharedBlobDir,
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: flagPrefix + "daemon-host",
|
||||
Usage: "use docker daemon host at `HOST` (docker-daemon: only)",
|
||||
Destination: &opts.dockerDaemonHost,
|
||||
},
|
||||
}, &opts
|
||||
}
|
||||
|
||||
@@ -69,7 +75,7 @@ func contextFromImageOptions(c *cli.Context, opts *imageOptions) (*types.SystemC
|
||||
OCISharedBlobDirPath: opts.sharedBlobDir,
|
||||
DirForceCompress: c.Bool(opts.flagPrefix + "compress"),
|
||||
AuthFilePath: c.String("authfile"),
|
||||
DockerDaemonHost: c.String(opts.flagPrefix + "daemon-host"),
|
||||
DockerDaemonHost: opts.dockerDaemonHost,
|
||||
DockerDaemonCertPath: opts.dockerCertPath,
|
||||
}
|
||||
if opts.tlsVerify.present {
|
||||
|
Reference in New Issue
Block a user