Skip to content

Commit

Permalink
Merge pull request containers#15363 from rhatdan/secret
Browse files Browse the repository at this point in the history
podman secret create -d alias --driver, inspect -f alias --format: Docker compatibity
  • Loading branch information
openshift-merge-robot authored Aug 22, 2022
2 parents bbbed3d + f6e7b0b commit e9fe85d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/podman/secrets/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func init() {

cfg := registry.PodmanConfig()

flags.StringVar(&createOpts.Driver, driverFlagName, cfg.Secrets.Driver, "Specify secret driver")
flags.StringVarP(&createOpts.Driver, driverFlagName, "d", cfg.Secrets.Driver, "Specify secret driver")
flags.StringToStringVar(&createOpts.DriverOpts, optsFlagName, cfg.Secrets.Opts, "Specify driver specific options")
_ = createCmd.RegisterFlagCompletionFunc(driverFlagName, completion.AutocompleteNone)
_ = createCmd.RegisterFlagCompletionFunc(optsFlagName, completion.AutocompleteNone)
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/secrets/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func init() {
})
flags := inspectCmd.Flags()
formatFlagName := "format"
flags.StringVar(&format, formatFlagName, "", "Format volume output using Go template")
flags.StringVarP(&format, formatFlagName, "f", "", "Format volume output using Go template")
_ = inspectCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(&entities.SecretInfoReport{}))
}

Expand Down
2 changes: 1 addition & 1 deletion docs/source/markdown/podman-secret-create.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Secrets will not be committed to an image with `podman commit`, and will not be

## OPTIONS

#### **--driver**=*driver*
#### **--driver**, **-d**=*driver*

Specify the secret driver (default **file**, which is unencrypted).

Expand Down
2 changes: 1 addition & 1 deletion docs/source/markdown/podman-secret-inspect.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Secrets can be queried individually by providing their full name or a unique par

## OPTIONS

#### **--format**=*format*
#### **--format**, **-f**=*format*

Format secret output using Go template.

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var _ = Describe("Podman secret", func() {
err := ioutil.WriteFile(secretFilePath, []byte("mysecret"), 0755)
Expect(err).To(BeNil())

session := podmanTest.Podman([]string{"secret", "create", "--driver-opts", "opt1=val", "a", secretFilePath})
session := podmanTest.Podman([]string{"secret", "create", "-d", "file", "--driver-opts", "opt1=val", "a", secretFilePath})
session.WaitWithDefaultTimeout()
secrID := session.OutputToString()
Expect(session).Should(Exit(0))
Expand All @@ -49,7 +49,7 @@ var _ = Describe("Podman secret", func() {
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(Exit(0))
Expect(inspect.OutputToString()).To(Equal(secrID))
inspect = podmanTest.Podman([]string{"secret", "inspect", "--format", "{{.Spec.Driver.Options}}", secrID})
inspect = podmanTest.Podman([]string{"secret", "inspect", "-f", "{{.Spec.Driver.Options}}", secrID})
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(Exit(0))
Expect(inspect.OutputToString()).To(ContainSubstring("opt1:val"))
Expand Down

0 comments on commit e9fe85d

Please sign in to comment.