Skip to content

Commit a137009

Browse files
stttssoltysh
authored andcommitted
UPSTREAM: <carry>: warn only about unknown feature gates
openshift-rebase(v1.24):source=8d9bda8f24c
1 parent 439ec41 commit a137009

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

staging/src/k8s.io/component-base/featuregate/feature_gate.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ func (f *featureGate) SetFromMap(m map[string]bool) error {
220220
k := Feature(k)
221221
featureSpec, ok := known[k]
222222
if !ok {
223-
return fmt.Errorf("unrecognized feature gate: %s", k)
223+
klog.Warningf("unrecognized feature gate: %s", k)
224+
continue
224225
}
225226
if featureSpec.LockToDefault && featureSpec.Default != v {
226227
return fmt.Errorf("cannot set feature gate %v to %v, feature is locked to %v", k, v, featureSpec.Default)

staging/src/k8s.io/component-base/featuregate/feature_gate_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func TestFeatureGateFlag(t *testing.T) {
5252
testAlphaGate: false,
5353
testBetaGate: false,
5454
},
55-
parseError: "unrecognized feature gate: fooBarBaz",
55+
//parseError: "unrecognized feature gate: fooBarBaz",
5656
},
5757
{
5858
arg: "AllAlpha=false",
@@ -356,7 +356,7 @@ func TestFeatureGateSetFromMap(t *testing.T) {
356356
testAlphaGate: false,
357357
testBetaGate: false,
358358
},
359-
setmapError: "unrecognized feature gate:",
359+
//setmapError: "unrecognized feature gate:",
360360
},
361361
{
362362
name: "set locked gates",

0 commit comments

Comments
 (0)