-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strip key/values of external quotes #21000
Conversation
I also looked at this issue. The problem is that some keys do require keeping the double quotes. See the hostname.container test which fails. |
I was wondering that. |
After looking at the failures, I think the new code is correct, stripping the quotes. I believe this matches better with systemd. |
test/e2e/quadlet/quotes.container
Outdated
## assert-podman-final-args localhost/imagename | ||
## assert-podman-args "RemoveQuotesName" | ||
|
||
[Container] | ||
Image="localhost/imagename" | ||
Name="RemoveQuotesName" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## assert-podman-final-args localhost/imagename | |
## assert-podman-args "RemoveQuotesName" | |
[Container] | |
Image="localhost/imagename" | |
Name="RemoveQuotesName" | |
## assert-podman-final-args localhost/imagename | |
## assert-podman-args "--name=RemoveQuotes\"Name" | |
[Container] | |
Image="localhost/imagename" | |
ContainerName="RemoveQuotes"Name" |
You're right. Not sure why, but when I ran it yesterday without the quotes the hostname was not set. I've tested it again and it even makes more sense now. Don't know what went wrong |
But is striping the quotes actually the problem? I would think systemd uses some form of escape logic similar to the shell so just stripping does not sounds right. https://www.freedesktop.org/software/systemd/man/latest/systemd.syntax.html If you look at pkg/systemd/parser/split.go there is already a bunch of code to take care of thie escaping AFAICT so I would assume you would need to use that to correctly parse values. |
@Luap99 I don't see anything obvious there. Most of those look like something that splits a string into a series of arguments, similar to shlex. |
Signed-off-by: Daniel J Walsh <[email protected]>
|
I don't have time to work on this and it is a simple enough change, that I think we should just merge, and if you want to open an issue to create a better fix in the future lets open that. @vrothberg @giuseppe @Luap99 @ashley-cui @mheon @baude @ygalblum @umohnani8 PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Thanks for this fix! It seems ready to merge, although some MAc and Windows checks failed. |
Needs a rebase to fix Windows CI, Mac is an expected failure |
7cb0c2e
into
containers:main
Does this PR introduce a user-facing change?
Fixes: #20992