Skip to content

Commit

Permalink
cli: podman kube play --log-opt use StringArray()
Browse files Browse the repository at this point in the history
This option accepts arbitrary input so we should allow commas in it.

Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Luap99 committed Dec 11, 2023
1 parent 48ab4ae commit 2be4b00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/podman/kube/play.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func playFlags(cmd *cobra.Command) {
_ = cmd.RegisterFlagCompletionFunc(logDriverFlagName, common.AutocompleteLogDriver)

logOptFlagName := "log-opt"
flags.StringSliceVar(
flags.StringArrayVar(
&playOptions.LogOptions,
logOptFlagName, []string{},
"Logging driver options",
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/play_kube_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4886,7 +4886,7 @@ ENV OPENJ9_JAVA_OPTIONS=%q
err := generateKubeYaml("pod", pod, kubeYaml)
Expect(err).ToNot(HaveOccurred())

kube := podmanTest.Podman([]string{"kube", "play", kubeYaml, "--log-driver", "journald", "--log-opt", "tag={{.ImageName}}"})
kube := podmanTest.Podman([]string{"kube", "play", kubeYaml, "--log-driver", "journald", "--log-opt", "tag={{.ImageName}},withcomma"})
kube.WaitWithDefaultTimeout()
Expect(kube).Should(ExitCleanly())

Expand All @@ -4897,7 +4897,7 @@ ENV OPENJ9_JAVA_OPTIONS=%q
inspect := podmanTest.Podman([]string{"inspect", getCtrNameInPod(pod)})
inspect.WaitWithDefaultTimeout()
Expect(start).Should(ExitCleanly())
Expect((inspect.InspectContainerToJSON()[0]).HostConfig.LogConfig.Tag).To(Equal("{{.ImageName}}"))
Expect((inspect.InspectContainerToJSON()[0]).HostConfig.LogConfig.Tag).To(Equal("{{.ImageName}},withcomma"))
})

It("using a user namespace", func() {
Expand Down

0 comments on commit 2be4b00

Please sign in to comment.