-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Document that providers MUST validate references are in the same namespace #2318
Comments
We really should just have one type with
We can have it in our own types? |
I'd rather avoid having a I would say the same thing for references that are known types (Secret, ConfigMap, etc), for similar reasons. |
cross referencing PR kubernetes/kubernetes#87459 to provide more context. |
Also relevant PR to update the api conventions doc: kubernetes/community#4705 |
/kind cleanup |
/kind cleanup |
/cc |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/lifecycle frozen |
/milestone v0.4.0 |
I'm happy to work on this for https://github.com/kubernetes-sigs/cluster-api/milestone/16, also happy to help work with this on other folks if anyone else is interested in contributing to this. |
/milestone next |
@sbueringer: The provided milestone is not valid for this repository. Milestones in this repository: [ Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/milestone Next |
/triage accepted the ask to improve documentation is still valid; the discussion about how to model reference is tracked in #6539 so I suggest dropping it from this thread /help |
@fabriziopandini: GuidelinesPlease ensure that the issue body includes answers to the following questions:
For more details on the requirements of such an issue, please see here and ensure that they are met. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Stupid question, but is this only about adding documentation that control plane providers should validate their machine template ref? As far as I can tell no other bootstrap/ infra provider resource has to contain a ref according to the contract. Or do we also want to provide guidance for them in case they have ref's with ObjectReference in their types? |
I will keep this generic, because providers can have other references in their types as well (a recent example is infra objects referencing to IPClaims) |
/unassign @devigned |
@fabriziopandini I think I would close this issue:
|
/close |
@fabriziopandini: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Goals
corev1.ObjectReference
with more appropriate typesNon-Goals/Future Work
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
The text was updated successfully, but these errors were encountered: