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 []() 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:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user