-
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
A provider cannot tell whether the user wants a Machine to have no taints, or whether the user does not care #707
Comments
If taints are immutable and are applied once on initialization, as discusssed #651, then I think the authoritative/additive dilemma goes away: taints are authoritative, but only applied once. In that case, I think it would be useful to be able to express both "Don't care" and "Apply no taints." |
I should add that it is possible to set the This means that, when the |
Looks like this issue has come up before. Here's what the API conventions say:
|
Related to #552 |
I think you can easily work-around via the k8s api as a post-step. |
The same issue in the kubeadm types is being resolved by removing the I'll file a PR (that can be put on hold until after v1alpha1) |
/area api |
The kubeadm bootstrap provider (https://github.com/kubernetes-sigs/cluster-api-bootstrap-provider-kubeadm/) is using the kuebadm v1beta2 types, so it should be free from this problem. Other bootstrap providers will need to be aware of this issue. Something to keep in mind for the future set of CAPI conformance tests. Time to close this issue? |
+1 to closing |
/kind bug
What steps did you take and what happened:
I wanted to create a Machine and have the provider apply no taints to it. My provider uses kubeadm, which applies a default set of taints, unless the user specifies a set of taints, or indicates "no taints" by setting the field (a slice) to its zero value.
What did you expect to happen:
I expect to be able to express all of the following in the
Spec.Taints
field:(a) Don't care; the provider can apply default taints.
(b) Apply no taints.
(c) Apply one or more taints I specify.
In the current API, I can't express all of these. My provider can interpret an empty slice to mean either (a) or (b), but not both.
Anything else you would like to add:
If the[Update: It is possible to express (a), (b), and (c) using the current field. However, both aSpec.Taints
field were a pointer to a slice, it would be possible to express both (a) and (b) by attaching different meanings tonil
vs. empty slice.nil
and an empty slice are omitted when theTaints
field is marshalled. ]The desire to apply no taints means that the
Spec.Taints
field is authoritative. @derekwaynecarr suggested that the field should be additive, not authoritative. Being additive allows automation running concurrently with the provider to set its own set of taints. On the other hand, being authoritative is the only way to say that a Machine should have no taints.I believe kubeadm has a similar issue with its own API. I filed kubernetes/kubeadm#1358.
The text was updated successfully, but these errors were encountered: