Merge pull request #25458 from errm/env-var-style-config-keys

Automatic merge from submit-queue

Allow Secret & ConfigMap keys to contain caps, dots, and underscores

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()

Re: #23722

This makes loosens the regex used in in Secrets and ConfigMap,
in order to make environment variable style keys valid
This commit is contained in:
Kubernetes Submit Queue
2016-08-02 21:00:52 -07:00
committed by GitHub
4 changed files with 22 additions and 10 deletions

View File

@@ -377,11 +377,14 @@ func TestIsValidPercent(t *testing.T) {
func TestIsConfigMapKey(t *testing.T) {
successCases := []string{
"a",
"good",
"good-good",
"still.good",
"this.is.also.good",
".so.is.this",
"THIS_IS_GOOD",
"so_is_this_17",
}
for i := range successCases {
@@ -391,14 +394,16 @@ func TestIsConfigMapKey(t *testing.T) {
}
failureCases := []string{
"bad_bad",
".",
"..",
"..bad",
"bad.",
"b*d",
"bad!&bad",
}
for i := range failureCases {
if errs := IsConfigMapKey(failureCases[i]); len(errs) == 0 {
t.Errorf("[%d] expected success", i)
t.Errorf("[%d] expected failure", i)
}
}
}