Skip to content

Commit 884f256

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request kubernetes#55274 from venezia/enhance_label_taint_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 ```
2 parents e568aa7 + 53b3b5b commit 884f256

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pkg/kubectl/cmd/label.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ var (
7070
labelLong = templates.LongDesc(i18n.T(`
7171
Update the labels on a resource.
7272
73-
* A label must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to %[1]d characters.
73+
* 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.
74+
* Optionally, the key can begin with a DNS subdomain prefix and a single '/', like example.com/my-app
7475
* If --overwrite is true, then existing labels can be overwritten, otherwise attempting to overwrite a label will result in an error.
7576
* If --resource-version is specified, then updates will use this resource version, otherwise the existing resource-version will be used.`))
7677

pkg/kubectl/cmd/taint.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ var (
5858
5959
* A taint consists of a key, value, and effect. As an argument here, it is expressed as key=value:effect.
6060
* The key must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to %[1]d characters.
61+
* Optionally, the key can begin with a DNS subdomain prefix and a single '/', like example.com/my-app
6162
* The value must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to %[2]d characters.
6263
* The effect must be NoSchedule, PreferNoSchedule or NoExecute.
6364
* Currently taint can only apply to node.`))

0 commit comments

Comments
 (0)