Skip to content

Commit 5a9094c

Browse files
authored
Merge pull request #19816 from k8s-infra-cherrypick-robot/cherry-pick-19803-to-release-3.6
[release-3.6] pkg/featuregate: Return MutableFeatureGate interface in New function
2 parents 9e6394e + 2d8e725 commit 5a9094c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/featuregate/feature_gate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func setUnsetBetaGates(known map[Feature]FeatureSpec, enabled map[Feature]bool,
166166
// Set, String, and Type implement pflag.Value
167167
var _ pflag.Value = &featureGate{}
168168

169-
func New(name string, lg *zap.Logger) *featureGate {
169+
func New(name string, lg *zap.Logger) MutableFeatureGate {
170170
if lg == nil {
171171
lg = zap.NewNop()
172172
}

pkg/featuregate/feature_gate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func TestFeatureGateFlag(t *testing.T) {
219219
t.Errorf("%d: Parse() Expected nil, Got %v", i, err)
220220
}
221221
for k, v := range test.expect {
222-
actual := f.enabled.Load().(map[Feature]bool)[k]
222+
actual := f.Enabled(k)
223223
assert.Equalf(t, actual, v, "%d: expected %s=%v, Got %v", i, k, v, actual)
224224
}
225225
})

0 commit comments

Comments
 (0)