Skip to content

Commit

Permalink
Merge pull request kubernetes#55274 from venezia/enhance_label_taint_…
Browse files Browse the repository at this point in the history
…docs

Automatic merge from submit-queue (batch tested with PRs 55648, 55274, 54982, 51955, 55639). 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>.

Enhance label and taint documentation in kubectl

**What this PR does / why we need it**:
This adds some language around how taint and label keys can have a domain + '/' in front of them.  From the current documentation, it would seem like these are not allowed even though [well known labels](https://kubernetes.io/docs/reference/labels-annotations-taints/) have them.

Also, it seemed unclear (to me) that both the label's key and value can be 63 characters long.  I wanted to clarify this.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
None

**Special notes for your reviewer**:
Phrasing of "_DNS subdomain prefix and '/'_" was copied from [a validator's message](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L57) ... I'm unsure if its the best wording, but wanted to be consistent with the validator.

**Release note**:
```release-note
NONE
```
  • Loading branch information
Kubernetes Submit Queue authored Nov 15, 2017
2 parents e568aa7 + 53b3b5b commit 884f256
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/kubectl/cmd/label.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ var (
labelLong = templates.LongDesc(i18n.T(`
Update the labels on a resource.
* A label must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to %[1]d characters.
* A label key and value must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to %[1]d characters each.
* Optionally, the key can begin with a DNS subdomain prefix and a single '/', like example.com/my-app
* If --overwrite is true, then existing labels can be overwritten, otherwise attempting to overwrite a label will result in an error.
* If --resource-version is specified, then updates will use this resource version, otherwise the existing resource-version will be used.`))

Expand Down
1 change: 1 addition & 0 deletions pkg/kubectl/cmd/taint.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,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 effect must be NoSchedule, PreferNoSchedule or NoExecute.
* Currently taint can only apply to node.`))
Expand Down

0 comments on commit 884f256

Please sign in to comment.