diff --git a/pkg/systemd/parser/unitfile.go b/pkg/systemd/parser/unitfile.go index dadd7d849d..b24c9d3bc1 100644 --- a/pkg/systemd/parser/unitfile.go +++ b/pkg/systemd/parser/unitfile.go @@ -622,7 +622,7 @@ func (f *UnitFile) Lookup(groupName string, key string) (string, bool) { return "", false } - return strings.TrimRightFunc(v, unicode.IsSpace), true + return strings.Trim(strings.TrimRightFunc(v, unicode.IsSpace), "\""), true } // Lookup the last instance of a key and convert the value to a bool diff --git a/test/e2e/quadlet/health.container b/test/e2e/quadlet/health.container index a80b67fbc9..766359e50f 100644 --- a/test/e2e/quadlet/health.container +++ b/test/e2e/quadlet/health.container @@ -1,6 +1,6 @@ [Container] Image=localhost/imagename -## assert-podman-args "--health-cmd" "\"hello world\"" +## assert-podman-args "--health-cmd" "hello world" HealthCmd="hello world" ## assert-podman-args "--health-interval" "1m" HealthInterval=1m diff --git a/test/e2e/quadlet/hostname.container b/test/e2e/quadlet/hostname.container index c239b8667e..87a8d858bf 100644 --- a/test/e2e/quadlet/hostname.container +++ b/test/e2e/quadlet/hostname.container @@ -1,4 +1,4 @@ [Container] Image=localhost/imagename -## assert-podman-args "--hostname" "\"quadlet-host\"" -HostName="quadlet-host" +## assert-podman-args "--hostname" "quadlet-host" +HostName=quadlet-host diff --git a/test/e2e/quadlet/quotes.container b/test/e2e/quadlet/quotes.container new file mode 100644 index 0000000000..b34d16811f --- /dev/null +++ b/test/e2e/quadlet/quotes.container @@ -0,0 +1,6 @@ +## assert-podman-final-args localhost/imagename +## assert-podman-args --name=RemoveQuotes\"Name + +[Container] +Image="localhost/imagename" +ContainerName="RemoveQuotes"Name" diff --git a/test/e2e/quadlet_test.go b/test/e2e/quadlet_test.go index ef0057da25..0675332b07 100644 --- a/test/e2e/quadlet_test.go +++ b/test/e2e/quadlet_test.go @@ -792,6 +792,7 @@ BOGUS=foo Entry("ports.container", "ports.container", 0, ""), Entry("ports_ipv6.container", "ports_ipv6.container", 0, ""), Entry("pull.container", "pull.container", 0, ""), + Entry("quotes.container", "quotes.container", 0, ""), Entry("readonly.container", "readonly.container", 0, ""), Entry("readonly-tmpfs.container", "readonly-tmpfs.container", 0, ""), Entry("readonly-notmpfs.container", "readonly-notmpfs.container", 0, ""),