question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Patching of a Custom Resource does not work in v6.1.1

See original GitHub issue

Have 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:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
shawkinscommented, Sep 22, 2022

it works just fine, doing the same on the above custom resource simply does nothing.

@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.

1reaction
danpfecommented, Sep 22, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found