Skip to content

Stop using owner references to determine ClusterResourceSetBinding cluster #7669

@killianmuldoon

Description

@killianmuldoon

The current implementation of the ClusterResourceSetBinding controller uses the owner references in objectMeta to determine which cluster the resource binding applies to.

As a result the ClusterResourceSetBinding requires two ownerReferences - one to the ClusterResourceSet and a second to the Cluster.

Currently the ClusterResourceSetBinding is always named after the Cluster it's associated with, so this name could be used to link the two. Alternatively the ClusterResourceSetBinding .spec could contain a clusterName field to link it to the Cluster. The second approach is more stable and explicit IMO.

The approach I'd propose is:

  1. add a clusterName to the ClusterResourceSetBinding spec
  2. use spec.clusterName to link ClusterResourceSetBinding to the Cluster's they link to - and use that link to decide when to delete.
  3. remove the Cluster owner reference from the ClusterResourceSetBinding

Metadata

Metadata

Assignees

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions