-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix pull parameter parsing for compat /build
endpoint
#19591
Fix pull parameter parsing for compat /build
endpoint
#19591
Conversation
I do not insist on the second commit but we definitely must revert #18583. |
Or if you do not like proliferation of |
/cc @mheon |
/build
endpoint
wrt |
eb56909
to
18fba27
Compare
d31b733
to
7622bfc
Compare
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
Its weird though to drift away from docs here: https://docs.docker.com/engine/api/v1.42/#tag/Image/operation/ImageBuild ( but since your investigation points that there might be an issue with the docker documentation itself, I am convinced ) lets wait for other maintainers.
This is a breaking change even if this is reverting to an old behavior.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: flouthoc, matejvasek 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 |
Please add rather verbose explanations on why we are reverting the commit. It has already been released. |
#17778 (comment) sounds reasonable but I agree with @vrothberg, explanations like this should be part of the commit message. |
Is there a test to make sure the libpod entry point still works with the string passing? |
@rhatdan I don't know, but I think I have not touched libpod part at all. |
One questionable thing about this PR is changing boolean parser for all query params of all compat endpoints. |
But it changes it in mostly compatible way. Strings "true", "1" are still |
@vrothberg @Luap99 I updated description. |
@Luap99 Wholeheartedly agree, but tell that to |
Also as I said I am fine with just reverting to previous state where presumably |
@@ -580,19 +579,8 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { | |||
pullPolicy = buildahDefine.PolicyMap[query.PullPolicy] | |||
} else { | |||
if _, found := r.URL.Query()["pull"]; found { |
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.
@Luap99 Is this found
guard needed? Why?
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.
I mean if the pull param is not present then quar.yPull is false anyway right?
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.
Yes I don't think that is needed and should work without it.
@Luap99 I fixed decoder discrimination for libpod and compat endpoints. |
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
Draft of little bit more conservative fix /~https://github.com/containers/podman/pull/19601/files |
I don't see it in the commits. |
@matejvasek I think PR description is updated but still it looks less verbose as compared to your investigation here #17778 (comment), I'd vote for including this in commit body or alteast a link to it: #17778 (comment) |
This reverts commit 5b148a0. Reverting to treating the `pull` query parameter as a boolean. Because of deceiving Docker API documentation it was assumed that the parameter is pull-policy, however that is not true. Docker does treat `pull` as a boolean. What is interesting is that Docker indeed accepts strings like `always` or `never` however Docekr both of these strings treat as `true`, not as pull-policy. As matter of the fact it seems there is no such a thing as pull-policy in Docker. More context containers#17778 (comment) Signed-off-by: Matej Vasek <mvasek@redhat.com>
6120607
to
a3f1451
Compare
@vrothberg @flouthoc I updated commit message. |
In Docker anything but "", "0", "no", "false", "none" (ignoring case) is considered to be true. Signed-off-by: Matej Vasek <mvasek@redhat.com>
a3f1451
to
f33b01b
Compare
/lgtm |
@rhatdan will this be eligible for 4.6.2? |
I think backporting #19601 makes more sense IMO as this one has less risk involved, if you need the backport in RHEL you need to file a bugzilla as 4.6.1-rhel is already frozen for RHEL. |
What will be time period between 4.6.1-rhel and 4.6.2-rhel ? @Luap99 |
There will never be a 4.6.2 in RHEL, RHEL is frozen for each minor RHEL release. Then only approved backports are allowed to the rhel branches so you need to file bugzillas (or Jira bugs soon) for those in order to get this fixed in RHEL. |
@Luap99 I absolutely want this fix in rhel. |
@Luap99 https://issues.redhat.com or somewhere else? |
@matejvasek I think this is what you're looking for: https://bugzilla.redhat.com/show_bug.cgi?id=2232127 |
@TomSweeneyRedHat yeah I created that issue after chat on Slack with @Luap99 . |
Changes
Fixing Docker client incompatibility:
Previously it was believed the
pull
parameter is pull-policy since REST API doc says it isstring
, notbool
. However it fact it is a boolean. Confusingly enough Docker indeed accept values likealways
ornever
but these values are interpreted astrue
by Docker. As matter of the fact it appears that there is no such a thing aspull-policy
in Docker.This means anything but
""
,"0"
,"no"
,"false"
,"none"
(ignoring case) is considered to be true.More context: #17778 (comment)