Patching of a Custom Resource does not work in v6.1.1
See original GitHub issueHave a custom resource, defined as:
@Group("mysamplegroup")
@Version("v1")
public class Sample extends CustomResource<SampleSpec, SampleStatus> implements Namespaced {
// ...
}
When I do client.resource(some_Default_Resource_Such_As_A_Pod).patch();
it works just fine, doing the same on the above custom resource simply does nothing.
Doing it the old and deprecated way client.customResource(Sample.class).inNamespace("default").withName("something").patch(myCustomResource);
works, however.
Is this a bug or am I misunderstanding something about the new API?
Thanks!
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Update - AWS CloudFormation
Learn how to update custom resource request types in AWS CloudFormation. ... AWS CloudFormation does not transform, modify, or redact any information you ......
Read more >N-able N-central Patch Management is not installing patches
N-able N-central Patch Management is not installing patches - General Troubleshooting · Last Modified · Description · Environment · Solution.
Read more >VMware Tanzu Kubernetes Grid 1.6 Release Notes
When you run Kubernetes Image Builder to create a custom Linux custom machine image, the goss tests python-netifaces , python-requests , and ebtables...
Read more >What's New in Oracle WebLogic Server 12.2.1.3.0
You can use partition-specific deployment plans to customize any application deployed to a resource group template or resource group within a partition.
Read more >Release Notes | Firebase - Google
For example, you can include custom fields, helpful deep-links into the Firebase console, or add company-specific troubleshooting information.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@danpfe @rohanKanojia the logic is the same either way. I think there’s a problem no matter which resource type you use.
This is a regression with #4142 I think the intent of the change was so that patch(item) methods would be against the current item, rather than what was from the server - resource(item1).patch(item2) will create a diff between item1 and item2, which is also consistent with how the edit and accept methods worked. With the patch() call it’s just diffing to itself.
I think that it’s better to have the patch() method specifically update the context to ensure the server side item is used, rather than going back to always loading the server side item as the base.
Don’t know if that helps but here is the “sample-operator” that I updated to 6.1.1 and that I used as template to build other operators (that worked with the legacy API): https://github.com/codelair-io/example-k8s-operator-java/tree/master/src/main/java/io/codelair/examples/kubernetesoperator