mirror of https://github.com/containers/podman.git
cli: podman --hooks-dir use StringArray()
This option accepts a file path so we should allow commas in it. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
12c39ffda2
commit
c5258d4630
|
|
@ -541,7 +541,7 @@ func rootFlags(cmd *cobra.Command, podmanConfig *entities.PodmanConfig) {
|
|||
_ = cmd.RegisterFlagCompletionFunc(eventsBackendFlagName, common.AutocompleteEventBackend)
|
||||
|
||||
hooksDirFlagName := "hooks-dir"
|
||||
pFlags.StringSliceVar(&podmanConfig.HooksDir, hooksDirFlagName, podmanConfig.ContainersConfDefaultsRO.Engine.HooksDir.Get(), "Set the OCI hooks directory path (may be set multiple times)")
|
||||
pFlags.StringArrayVar(&podmanConfig.HooksDir, hooksDirFlagName, podmanConfig.ContainersConfDefaultsRO.Engine.HooksDir.Get(), "Set the OCI hooks directory path (may be set multiple times)")
|
||||
_ = cmd.RegisterFlagCompletionFunc(hooksDirFlagName, completion.AutocompleteDefault)
|
||||
|
||||
pFlags.IntVar(&podmanConfig.MaxWorks, "max-workers", (runtime.NumCPU()*3)+1, "The maximum number of workers for parallel operations")
|
||||
|
|
|
|||
|
|
@ -916,7 +916,7 @@ USER bin`, BB)
|
|||
|
||||
It("podman test hooks", func() {
|
||||
SkipIfRemote("--hooks-dir does not work with remote")
|
||||
hooksDir := tempdir + "/hooks"
|
||||
hooksDir := tempdir + "/hooks,withcomma"
|
||||
err := os.Mkdir(hooksDir, 0755)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
hookJSONPath := filepath.Join(hooksDir, "checkhooks.json")
|
||||
|
|
|
|||
Loading…
Reference in New Issue