-
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
play: kube: support io.reader body arg and remove tempfiles #13606
play: kube: support io.reader body arg and remove tempfiles #13606
Conversation
bfcba6e
to
bf6eb16
Compare
@Luap99 I've implemented what you requested for the bindings - removed the new Body param and now added new functions KubeWithBody and KubeDownWithBody. |
ba841aa
to
7fc33b6
Compare
ecdba84
to
67cf759
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, one small nit but not worth to repush for that.
LGTM |
67cf759
to
e36ba5f
Compare
Tests appear to be flaking :) |
Yeah this happens regularly, we can restart them manually if needed. Also github was down earlier so that likely confused the CI tests. |
I'll re-run the tests, but most of the failures are remote play kube, which seems suspicious |
This test passes for me when I run it locally. ... That said, I did notice that while you can construct an engine with ClientCtx:
The client context is not always used, for example when the parameters of a call have a context:
In this case, if the client is not attached to the context: podman/pkg/bindings/connection.go Line 46 in 80123ca
The error "Client is not attached to context" will be returned. Regardless of if ClientCtx had it attached. I'll try to figure out why it's breaking this way. |
e36ba5f
to
be55be0
Compare
The tests pass locally & there were no changes in which context.Context was used anywhere in the code, so I don't know why that one ubuntu test is failing. .. unless ic.ClientCtx, registry.GetContext() do not have the Client set on them. Or in the HTTP request handler, it uses the http request context - but this is no different from how it is on the main branch, so I don't see why it would suddenly stop working now. |
The PlayKube and PlayKubeDown commands accepted a "path" argument to a YAML file to play. This requires the caller to write the YAML to a file path. The downside of this is apparent in the HTTP handlers which have to use a temporary file on disk to store the YAML file. The file is opened & used as the body of the HTTP request. It's possible to instead pass a io.Reader and use a fully in-memory request body. Add backwards-compatible changes to bindings to allow passing either a filepath or a io.Reader body. Refactor the podman bindings to use a io.Reader instead of a filepath. Simplify the HTTP handlers for PlayKube by removing the now unneeded tempfile. [NO NEW TESTS NEEDED] Signed-off-by: Christian Stewart <christian@paral.in>
be55be0
to
7526803
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99, paralin 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 |
/lgtm |
The PlayKube and PlayKubeDown commands accept a "path" argument to a YAML file to play. This requires the caller to write the YAML to a file path.
The file is opened & used as the body of the HTTP request, it is possible to instead pass a io.Reader and use a fully in-memory YAML config without needing a temporary file on disk.