-
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
Forwarding Play Kube HTTP API configmaps query parameter to the container engine #12243
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jakub-dzon The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@umohnani8 PTAL |
fbd5c11
to
8428afe
Compare
@jakub-dzon you need to add a test. |
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.
Please update the swagger comments in pkg/api/server/register_play.go with the new query parameter.
8428afe
to
fa2e2d7
Compare
/retest |
@jakub-dzon: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
When I tried to pass correct configmap path via HTTP client while invoking Podman Play Kube API, there was an error returned and the following error reported in Podman logs: ``` Nov 09 18:45:33 fedora podman[2401215]: time="2021-11-09T18:45:33+01:00" level=info msg="Request Failed(Internal Server Error): error playing YAML file: Configmap device-config-map not found" Nov 09 18:45:33 fedora podman[2401215]: @ - - [09/Nov/2021:18:45:30 +0100] "POST /v4.0.0/libpod/play/kube?configmaps=%2Fvar%2Flocal%2Fyggdrasil%2Fdevice%2Fdevice-config-map.yaml HTTP/1.1" 500 140 "" "Go-http-client/1.1" ``` As a result, the pod was not started and stuck in `Created` status. As it turns out, `configmaps` query parameter for `/v4.0.0/libpod/play/kube` was not forwared to the `ContainerEngine.PlayKube` with `PlayKubeOptions`. This change addresses that problem by mapping incoming `configmaps` query parameter to `options.ConfigMaps`. Signed-off-by: Jakub Dzon <[email protected]>
fa2e2d7
to
6c87ea8
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.
This doesn't make sense why do we send the path to file over the API. It will fail when you run the client on a different system. Ideally this would send the config map content over the API like the actual kube yaml file.
@Luap99 In our use case we are trying to leverage that functionality while running client and podman server on the same host using I agree that sending content of the config map would resolve the problem in all situation, but that looks like serious change to the API. |
@jakub-dzon We are already on v4.0 on the main branch so we can accept breaking changes to the API if needed. I understand that this will work on the same host but I think this is very ugly and not a good API. Given that this never worked I would rather change it right now when we still have the chance. |
@Luap99 Makes sense. I will close this PR. If it's OK with you, I'd like to work on a proper solution, starting probably in two weeks. What would be the best way to discuss ideas for implementing it? |
@TomSweeneyRedHat When's the next community cabal? Could be a good topic. |
The next community cabal is on November 18th, we can add this as a topic to discuss there. |
Noted and added to my list of topics for the next Cabal meeting. |
https://hackmd.io/gQCfskDuRLm7iOsWgH2yrg?both for the agenda. The meeting is next Thu Nov 18 at 11:00 a.m. EST UTC-5. Conference room link in the agenda. |
Thank you! |
What this PR does / why we need it:
When I tried to pass correct configmap path via HTTP client while invoking Podman Play Kube API, there was an error returned and the following error reported in Podman logs:
As a result, the pod was not started and stuck in
Created
status. As it turns out,configmaps
query parameter for/v4.0.0/libpod/play/kube
was not forwared to theContainerEngine.PlayKube
withPlayKubeOptions
.This change addresses that problem by mapping incoming
configmaps
query parameter tooptions.ConfigMaps
.Signed-off-by: Jakub Dzon [email protected]
How to verify it
Create config map with some env variable; for example
/tmp/device-config-map.yaml
Create pod YAML file (/tmp/pod.yaml):
Execute following from a go program:
Without the fix, error described above would be reported.
Which issue(s) this PR fixes:
None
Special notes for your reviewer: