From ab6d901497692e6cbe1f8eed9bc2fc70b5d92804 Mon Sep 17 00:00:00 2001 From: Daniel Lipovetsky Date: Mon, 25 Feb 2019 16:21:09 -0800 Subject: [PATCH] Update kubectl taint usage - Explain that the value is optional. - Add example of adding a taint with no value to kubectl taint usage. --- pkg/kubectl/cmd/taint/taint.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/kubectl/cmd/taint/taint.go b/pkg/kubectl/cmd/taint/taint.go index 02f56513079..8f7a7d0c542 100644 --- a/pkg/kubectl/cmd/taint/taint.go +++ b/pkg/kubectl/cmd/taint/taint.go @@ -64,7 +64,7 @@ var ( * A taint consists of a key, value, and effect. As an argument here, it is expressed as key=value:effect. * The key must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to %[1]d characters. * Optionally, the key can begin with a DNS subdomain prefix and a single '/', like example.com/my-app - * The value must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to %[2]d characters. + * The value is optional. If given, it must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to %[2]d characters. * The effect must be NoSchedule, PreferNoSchedule or NoExecute. * Currently taint can only apply to node.`)) @@ -80,7 +80,10 @@ var ( kubectl taint nodes foo dedicated- # Add a taint with key 'dedicated' on nodes having label mylabel=X - kubectl taint node -l myLabel=X dedicated=foo:PreferNoSchedule`)) + kubectl taint node -l myLabel=X dedicated=foo:PreferNoSchedule + + # Add to node 'foo' a taint with key 'bar' and no value + kubectl taint nodes foo bar:NoSchedule`)) ) func NewCmdTaint(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command {