Allows Secret & ConfigMap Keys to look like Environment Variables

This makes environment variable style keys (uppercase with underscores) valid
in Secrets and ConfigMap.
This commit is contained in:
Ed Robinson
2016-05-11 06:59:59 +01:00
parent 897d277095
commit d4969ff032
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)
}
}
}