Merge pull request #63769 from liggitt/kubectl-taint-internal-object

Automatic merge from submit-queue (batch tested with PRs 55511, 63372, 63400, 63100, 63769). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

print result object from kubectl taint correctly

fixes #63767 

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2018-05-14 14:35:24 -07:00 committed by GitHub
commit 141e4ee0ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -4617,6 +4617,17 @@ __EOF__
}
__EOF__
# taint/untaint
# Pre-condition: node has no taints
kube::test::get_object_assert "nodes 127.0.0.1" "{{.spec.taints}}" '<no value>'
# taint can add a taint
kubectl taint node 127.0.0.1 dedicated=foo:PreferNoSchedule
kube::test::get_object_assert "nodes 127.0.0.1" '{{range .spec.taints}}{{.effect}}{{end}}' 'PreferNoSchedule'
# taint can remove a taint
kubectl taint node 127.0.0.1 dedicated-
# Post-condition: node has no taints
kube::test::get_object_assert "nodes 127.0.0.1" "{{.spec.taints}}" '<no value>'
### kubectl cordon update with --dry-run does not mark node unschedulable
# Pre-condition: node is schedulable
kube::test::get_object_assert "nodes 127.0.0.1" "{{.spec.unschedulable}}" '<no value>'

View File

@ -290,6 +290,7 @@ func (o TaintOptions) RunTaint() error {
if err != nil {
return err
}
outputObj = cmdutil.AsDefaultVersionedOrOriginal(outputObj, mapping)
printer, err := o.ToPrinter(operation)
if err != nil {