print result object from kubectl taint correctly

pull/8/head
Jordan Liggitt 2018-05-14 00:35:33 -04:00
parent 773def0194
commit 746bca241f
No known key found for this signature in database
GPG Key ID: 39928704103C7229
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 {