-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Goals
- Replace current uses of
corev1.ObjectReferencewith more appropriate types
Non-Goals/Future Work
- Modify other types used
User Story
As a consumer of Cluster API I would like to have fields that are currently using corev1.ObjectReference to use more appropriate data types so that it is clear which fields are used (all of them) vs having to guess which fields are in use.
Detailed Description
Upstream documentation discourages the use of corev1.ObjectReference: https://godoc.org/k8s.io/api/core/v1#ObjectReference. In order to align better with upstream convention we should adopt types that are more fitting for their purpose.
When the referenced type is constant and in the same namespace, we should likely use corev1.LocalObjectReference instead.
When we also need type information for the referenced resource and that resource is in the same namespace, we should likely use corev1.TypedLocalReference
If for some reason we need to cross namespaces with a reference, we should likely create our own type that is a subset of corev1.ObjectReference
To ease this transition, we should gracefully handle the conversions within the conversion webhooks.
Contract changes [optional]
Any type that is currently using corev1.ObjectReference would be updated to a more appropriate type.
Data model changes [optional]
Any type that is currently using corev1.ObjectReference would be updated to a more appropriate type.
/kind proposal