Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upkubeadm: Fix omitempty in v1beta2 #77345
+101
−29
Conversation
k8s-ci-robot
assigned
fabriziopandini
May 2, 2019
k8s-ci-robot
added
the
release-note-none
label
May 2, 2019
k8s-ci-robot
assigned
neolit123 and
timothysc
May 2, 2019
k8s-ci-robot
added
kind/cleanup
sig/cluster-lifecycle
area/kubeadm
priority/important-soon
size/L
labels
May 2, 2019
k8s-ci-robot
requested a review
from
dlipovetsky
May 2, 2019
k8s-ci-robot
added
the
cncf-cla: yes
label
May 2, 2019
This comment has been minimized.
This comment has been minimized.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rosti The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
k8s-ci-robot
added
the
approved
label
May 2, 2019
neolit123
reviewed
May 2, 2019
rosti
force-pushed the
rosti:omitempty-v1beta2
branch
from
2210219
to
81e3adc
May 3, 2019
k8s-ci-robot
assigned
dixudx
May 4, 2019
k8s-ci-robot
added
the
lgtm
label
May 4, 2019
This comment has been minimized.
This comment has been minimized.
|
/test pull-kubernetes-integration |
This comment has been minimized.
This comment has been minimized.
fejta-bot
commented
May 4, 2019
|
/retest Review the full test history for this PR. Silence the bot with an |
k8s-ci-robot
merged commit 0a83ed5
into
kubernetes:master
May 4, 2019
20 checks passed
cla/linuxfoundation
rosti authorized
Details
pull-kubernetes-bazel-build
Job succeeded.
Details
pull-kubernetes-bazel-test
Job succeeded.
Details
pull-kubernetes-conformance-image-test
Skipped.
pull-kubernetes-cross
Skipped.
pull-kubernetes-dependencies
Job succeeded.
Details
pull-kubernetes-e2e-gce
Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance
Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial
Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu
Job succeeded.
Details
pull-kubernetes-e2e-gce-storage-slow
Skipped.
pull-kubernetes-godeps
Skipped.
pull-kubernetes-integration
Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big
Job succeeded.
Details
pull-kubernetes-local-e2e
Skipped.
pull-kubernetes-node-e2e
Job succeeded.
Details
pull-kubernetes-typecheck
Job succeeded.
Details
pull-kubernetes-verify
Job succeeded.
Details
pull-publishing-bot-validate
Skipped.
tide
In merge pool.
Details
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
rosti commentedMay 2, 2019
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
There are a couple of problems with regards to the
omitemptyin v1beta1:It is not applied to certain fields. This makes emitting YAML configuration files in v1beta1 config format verbose by both kubeadm and third party Go lang tools. Certain fields, that were never given an explicit value would show up in the marshalled YAML document. This can cause confusion and even misconfiguration.
It can be used in inappropriate places. In this case it's used for fields, that need to be always serialized. The only one such field at the moment is
NodeRegistrationOptions.Taints. If theTaintsfield is nil, then it's defaulted to a slice containing a single control plane node taint. If it's an empty slice, no taints are applied, thus, the cluster behaves differently. With that in mind, a Go program, that uses v1beta1 withomitemptyon theTaintsfield has no way to specify an explicit empty slice of taints, as this would get lost after marshalling to YAML.To fix these issues the following is done in this change:
omitemptyis removed fromNodeRegistrationOptions.TaintsTaintsis included.Which issue(s) this PR fixes:
Fixes kubernetes/kubeadm#1358
Refs kubernetes/enhancements#970 kubernetes/kubeadm#1439
Special notes for your reviewer:
/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/area kubeadm
/priority important-soon
/assign @fabriziopandini
/assign @timothysc
/assign @neolit123
/cc @dlipovetsky
Does this PR introduce a user-facing change?: