crossplane-runtime
crossplane-runtime copied to clipboard
ProviderRef should not be of type ObjectReference
What happened?
ProviderReference field that exists in ResourceSpec is of type ObjectReference which has a lot of identifier such as name, namespace, uid, fieldpath etc. In some controllers, we call NamespacedNameOf function which returns an ObjectKey that includes the namespace. This is error-prone since users might add namespace and controller wouldn't be able to locate the object.
Provider objects are cluster-scoped and the type casting happens in managed resource reconciler, meaning its type is hard-coded in the codebase. So, we only need the name of the Provider object. We can have a type in crossplane-runtime like:
type ClusterScopedReference struct {
APIVersion string `json:"apiVersion,omitempty"
Kind string `json:"kind,omitempty"
Name string `json:"name"
How can we reproduce it?
Create a managed resource with providerRef that has namespace field populated.
What environment did it happen in?
Crossplane version: 0.5.1
Related to https://github.com/crossplane/crossplane-runtime/issues/49.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as stale because it has had no activity in the last 90 days. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.