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
Provide generic API to update metadata.ownerReferences field #2095
Comments
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
Well @Stale, I'm still interested. Mind keeping this open? |
We have been considering refactoring the behavior of |
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
There is a parallel issue (#2454) with an ongoing discussion for |
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
I am creating a kubernetes job and some associated resources ( secrets, network policies ). The job is auto-deleted using the .spec.ttlSecondsAfterFinished field.
Since kubernetes can not clean up the associated resources automatically, I am trying to update the .metadata.ownerReferences field after creating all resources and the job.
The code is essentially
However, the owned resources are not updated when calling
createOrReplace
. The reason seems to beThis calls
kubernetes-client/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/ResourceCompare.java
Line 35 in 8321522
Since my change is metadata-only, it is not applied.
As an update, I became aware of the option of using
edit().editMetadata()
on various resources. The problem here is that there is no generic way of doing it for all resource types, so I have to special-case every resource type that I manage. A generic API would be very much appreciated.The text was updated successfully, but these errors were encountered: