Skip to content
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

http 415 when patching the status of an un-typed resource #3379

Closed
lburgazzoli opened this issue Aug 4, 2021 · 8 comments
Closed

http 415 when patching the status of an un-typed resource #3379

lburgazzoli opened this issue Aug 4, 2021 · 8 comments
Milestone

Comments

@lburgazzoli
Copy link
Contributor

in my integration tests (against the k8s mock web server), I have to update the status of an unstructured object, so I'm doing something like:

client.
    .customResource(ctx)
    .inNamespace(namespace)
    .withName(name)
    .updateStatus(Serialization.asJson(unstructured));

this was working on fabric8 client 5.4.x (with a different dsl) but now, I'm getting HTTP 415
And a message that says:

Caused by: io.fabric8.kubernetes.client.KubernetesClientException:
    Failure executing: PATCH 
    at: http://localhost:49253/apis/camel.apache.org/v1alpha1/namespaces/test/foo/bar/status
@shawkins
Copy link
Contributor

shawkins commented Aug 4, 2021

To avoid a deprecated method call the RawCustomResourceOperationsImpl updateStatus method is now calling patchStatus - but that defaults to a json merge patch, which is not yet supported by the mock logic. The RawCustomResourceOperationsImpl should probably go back to calling the deprecated updateStatus method.

@lburgazzoli
Copy link
Contributor Author

@shawkins thx for digging into it, is there a workaround for this ?

@shawkins
Copy link
Contributor

shawkins commented Aug 4, 2021

Not through RawCustomResourceOperationsImpl and the mock server, no. The genericKubernetesResource will work and it also exposes the newer patch methods.

@lburgazzoli
Copy link
Contributor Author

@shawkins that's great so yes, using genericKubernetesResource works.

@gdauchet
Copy link

gdauchet commented Aug 9, 2021

To avoid a deprecated method call the RawCustomResourceOperationsImpl updateStatus method is now calling patchStatus - but that defaults to a json merge patch, which is not yet supported by the mock logic. The RawCustomResourceOperationsImpl should probably go back to calling the deprecated updateStatus method.

I have a question in #3385 you commented that it would be better to go back to the deprecated method but my PR is trying to support json merge patch in the mock, is not it the good solution ?

@shawkins
Copy link
Contributor

shawkins commented Aug 9, 2021

I have a question in #3385 you commented that it would be better to go back to the deprecated method but my PR is trying to support json merge patch in the mock, is not it the good solution ?

As mentioned on the pr it's more like a separate enhancement, not a specific fix for this issue. patchStatus is sementically different than updateStatus, so the direct fix is change the raw calls back to updateStatus.

@gdauchet
Copy link

gdauchet commented Aug 9, 2021

I have a question in #3385 you commented that it would be better to go back to the deprecated method but my PR is trying to support json merge patch in the mock, is not it the good solution ?

As mentioned on the pr it's more like a separate enhancement, not a specific fix for this issue. patchStatus is sementically different than updateStatus, so the direct fix is change the raw calls back to updateStatus.

Oki thanks so I will create an issue about supporting json merge patch in the mock and do a corresponding issue. And it will also solve this one

@manusa
Copy link
Member

manusa commented Aug 12, 2021

Fixed by #3395

@manusa manusa closed this as completed Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants