mirror of
https://github.com/containers/podman
synced 2024-10-19 08:44:11 +00:00
fix create&run getting --authfile from cli
Add flag `--authfile` to create and run so Podman can read authfile path from not only environemnt variable REGISTRY_AUTH_FILE but also CLI Signed-off-by: Qi Wang <qiwan@redhat.com>
This commit is contained in:
parent
66ae8ec037
commit
cfdf891552
|
@ -83,7 +83,7 @@ func CreateContainer(ctx context.Context, c *GenericCLIResults, runtime *libpod.
|
|||
} else {
|
||||
return nil, nil, errors.Errorf("error, no input arguments were provided")
|
||||
}
|
||||
newImage, err := runtime.ImageRuntime().New(ctx, name, rtc.SignaturePolicyPath, GetAuthFile(""), writer, nil, image.SigningOptions{}, false, nil)
|
||||
newImage, err := runtime.ImageRuntime().New(ctx, name, rtc.SignaturePolicyPath, GetAuthFile(c.String("authfile")), writer, nil, image.SigningOptions{}, false, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
|
|
@ -366,6 +366,7 @@ func NewIntermediateLayer(c *cliconfig.PodmanCommand, remote bool) GenericCLIRes
|
|||
m["add-host"] = newCRStringSlice(c, "add-host")
|
||||
m["annotation"] = newCRStringSlice(c, "annotation")
|
||||
m["attach"] = newCRStringSlice(c, "attach")
|
||||
m["authfile"] = newCRString(c, "authfile")
|
||||
m["blkio-weight"] = newCRString(c, "blkio-weight")
|
||||
m["blkio-weight-device"] = newCRStringSlice(c, "blkio-weight-device")
|
||||
m["cap-add"] = newCRStringSlice(c, "cap-add")
|
||||
|
|
|
@ -127,6 +127,10 @@ var _ = Describe("Podman login and logout", func() {
|
|||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"run", "--authfile", authFile, testImg})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"logout", "--authfile", authFile, server})
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue