Merge pull request #34020 from juanvallejo/jvallejo/allow-empty-annotation-values

Automatic merge from submit-queue

Allow empty annotation values

Related downstream issue: https://github.com/openshift/origin/issues/11175

**Release note**:
```release-note
release-note-none
```

Annotations with empty values can be used, for example, in diagnostics
logging. This patch removes the client-side check for empty values in
an annotation key-value pair.

**Before**
```
$ kubectl annotate pod zookeeper-1 node-selector="" --overwrite
error: invalid annotation format: node-selector=
```

**After**
```
$ kubectl annotate pod zookeeper-1 node-selector="" --overwrite
pod "zookeper-1" annotated
```

```
$ kubectl get po/zookeeper-1 --template='{{.metadata.annotations}}'
map[... node-selector: test-label:test]
```

@fabianofranz @liggitt
This commit is contained in:
Kubernetes Submit Queue
2016-10-05 11:48:02 -07:00
committed by GitHub
5 changed files with 27 additions and 10 deletions

View File

@@ -128,8 +128,8 @@ func TestParseLabels(t *testing.T) {
expectErr: true,
},
{
labels: []string{"a="},
expectErr: true,
labels: []string{"a="},
expected: map[string]string{"a": ""},
},
{
labels: []string{"a=%^$"},