mirror of
https://github.com/containers/podman.git
synced 2025-05-21 17:16:22 +08:00
Add podman secret inspect -f alias for --format: Docker compatibility
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -34,7 +34,7 @@ func init() {
|
|||||||
})
|
})
|
||||||
flags := inspectCmd.Flags()
|
flags := inspectCmd.Flags()
|
||||||
formatFlagName := "format"
|
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{}))
|
_ = inspectCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(&entities.SecretInfoReport{}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ Secrets can be queried individually by providing their full name or a unique par
|
|||||||
|
|
||||||
## OPTIONS
|
## OPTIONS
|
||||||
|
|
||||||
#### **--format**=*format*
|
#### **--format**, **-f**=*format*
|
||||||
|
|
||||||
Format secret output using Go template.
|
Format secret output using Go template.
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ var _ = Describe("Podman secret", func() {
|
|||||||
inspect.WaitWithDefaultTimeout()
|
inspect.WaitWithDefaultTimeout()
|
||||||
Expect(inspect).Should(Exit(0))
|
Expect(inspect).Should(Exit(0))
|
||||||
Expect(inspect.OutputToString()).To(Equal(secrID))
|
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()
|
inspect.WaitWithDefaultTimeout()
|
||||||
Expect(inspect).Should(Exit(0))
|
Expect(inspect).Should(Exit(0))
|
||||||
Expect(inspect.OutputToString()).To(ContainSubstring("opt1:val"))
|
Expect(inspect.OutputToString()).To(ContainSubstring("opt1:val"))
|
||||||
|
Reference in New Issue
Block a user