fabric8io / kubernetes-client

Java client for Kubernetes & OpenShift
http://fabric8.io
Apache License 2.0
3.32k stars 1.44k forks source link

Default owner reference blockOwnerDeletion to true #5838

Open shawkins opened 1 month ago

shawkins commented 1 month ago

Is your enhancement related to a problem? Please describe

Relates to https://github.com/operator-framework/java-operator-sdk/issues/2318 - the fabric8 logic is currently defaulting to null. the operator sdk is ok if the default behavior changes in fabric8. They don't expect that behavior will need to be configurable.

Describe the solution you'd like

For the fabric8 ownerReference creation method to default blockOwnerDeletion to true - that matches the default expected behavior of kubernetes.

Describe alternatives you've considered

No response

Additional context

No response

rohanKanojia commented 1 month ago

@shawkins : Is this issue related to Kubernetes Model? Or do we want to accommodate null value for blockOwnerDeletion while handing it in KubernetesClient?

csviri commented 1 month ago

If some will need this to be configurable, we can just override it on our side. But having this defaulted to true is probably the expected way to go IMO.

shawkins commented 1 month ago

Is this issue related to Kubernetes Model? Or do we want to accommodate null value for blockOwnerDeletion while handing it in KubernetesClient?

@rohanKanojia This is referring to the HasMetadata.addOwnerReference helper method, it's defaulting to null but true would be a better choice.

manusa commented 3 weeks ago

Would this be a breaking change? i.e. can we add this in 6.13, seems like low hanging fruit.

shawkins commented 3 weeks ago

Strictly speaking yes, but practially speaking no - it's what users should want by default.