-
Notifications
You must be signed in to change notification settings - Fork 519
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
[release-1.x] Patch namespace secret trigger an error due to unsupported media type #893
Comments
cc @davidgamero |
@JBWatenbergScality thanks for letting us know, did you have this working on the 0.x version prior? |
From a quick look through it seems like some of the media-types are missing in this list, but you may be able to supply one through the |
I had a similar problem with patching cronjobs and I was able to add headers via the options argument and get it working. For example:
|
I am currently working on fixing these outdated examples and getting the same. Notably on |
I'm taking a look at PatchNamespacedPod, and ran into an issue where supplying a new middleware wipes the configuration instead of merging it, resulting in an empty base server URL, but i've been trying out something like this:
and then passing that in the |
@davidgamero is there a reason we are still generating the client with |
@clintonmedbery good point that item should be updated for clarity- the generator we are using is the new i see 2 related issues here: we don't have a clear pattern or example for providing a custom patch strategy (this should be doable with the current requestContext middleware), and that some generated code has missing media types. Both appear to come from a disconnect in how the typescript generator creates the allowlist of media types and the swagger spec |
I was able to get Edit: I did try to fix this with middleware but debugging the operation proved that the operation was failing before it even got to my middleware. Issue is that ObjectSerializer doesn't support any of the the candidate media types for patching. |
* Add supportedMediaTypes needed for kubernetes client kubernetes-client/javascript#893 * Add generated files
@dleehr would your middleware solution work now if we would use the updated code from the openapi-generator which was merged recently? |
@mstruebing The middleware change is actually unnecessary. The client is already determining what the Content-Type should be for the request (an enhancement over 0.x), but the generated ObjectSerializer was blocking that. Updating the generated ObjectSerializer code was the only fix needed for 1.0.0-rc3. So I think regenerating with openapi-generator will fix it here. I hand-patched |
I believe in the past we supplied a custom ObjectSerializer, but I agree that it's cleaner to just contribute to the generator instead. Looking forward to the next rc since this should unblock a ton of routes! |
@dleehr Is there ETA for the available of 1.0.0-rc4 with this fix? Thansk a lot. |
By the way, is there any workaournd for this error on patchNamespacedSecret ? |
@brendandburns it'd be great if we can get a new rc when you have time please? |
@guomeng306 unfortunately there isnt a workaround in the current rc afaik without editing the generated object serializer to include the needed media types like @dleehr did. Im happy to point you to those changes,but we should have a new rc for you soon with the fix! |
@davidgamero understood. thanks so much. By the way, is there ETA for the available of 1.0.0-rc4 with this fix? e.g. possible in next two weeks? :) |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
is there a workaround for this, yet? I ran into this issue with v0.20.0. |
@jeromy-cannon this issue is from the 1.x releases, which included a workaround fix in 1.0.0-rc4 if you are experiencing this on a v0.x.x release, we may want to open a separate issue for tracking it as the 0.x and 1.x working branches are separate. iirc one 0.x release approach to this issue was the KubernetesObjectAPI which doesn't include all the same functionality yet on the 1.x branch, but should allow handling patch media types on 0.x releases also, it would help for repro if you could include the exact media type and what method call you are expecting to use- is it |
@davidgamero , thank you for the response. Great news on the workaround fix in 1.0.0-rc4. As a workaround I just did a get/delete/(update the payload from the get)/insert. Thank you for letting me know about the KubernetesObjectAPI, I might need to use that strategy in the future. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
I've run into this same issue and resolved it for now by using 1.0.0-rc4 - but I'm curious if anyone knows what the status of this release candidate is? How close is it to being cut as the official v1? |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". 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-sigs/prow repository. |
Describe the bug
When trying to use
patchNamespacedSecret
method on release-1.x branch the following error is raised:** Client Version **
release-1.x
** Server Version **
1.24.3
To Reproduce
Sample code triggering the error:
Also kind of related to this issue, I think we are missing a way to instruct
patchNamespacedSecret
which patch strategy we expect it to use. For example in the above example I expect it to useapplication/merge-patch+json
but have no way right now to provide the patch strategy.The text was updated successfully, but these errors were encountered: