Skip to content

Commit 40e2991

Browse files
committed
Simplify fetching and checking for featuregate ManagedClusterAutoApproval
Signed-off-by: Jeffrey Wong <[email protected]>
1 parent 0727737 commit 40e2991

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

pkg/cmd/init/exec.go

+2-8
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,9 @@ func (o *Options) validate() error {
159159
}
160160
}
161161

162-
featureGates := genericclioptionsclusteradm.ConvertToFeatureGateAPI(
163-
genericclioptionsclusteradm.HubMutableFeatureGate, ocmfeature.DefaultHubRegistrationFeatureGates)
164162
managedClusterAutoApprove := false
165-
for _, feature := range featureGates {
166-
if feature.Feature == "ManagedClusterAutoApproval" {
167-
if feature.Mode == "Enable" {
168-
managedClusterAutoApprove = true
169-
}
170-
}
163+
if genericclioptionsclusteradm.HubMutableFeatureGate.Enabled("ManagedClusterAutoApproval") {
164+
managedClusterAutoApprove = true
171165
}
172166

173167
if managedClusterAutoApprove {

0 commit comments

Comments
 (0)