Skip to content

Commit 39e999d

Browse files
author
Paulo Gomes
committed
git: Load default feature gates
Signed-off-by: Paulo Gomes <[email protected]>
1 parent 3fee9a5 commit 39e999d

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

controllers/gitrepository_controller.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,7 @@ func (r *GitRepositoryReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, o
141141
r.requeueDependency = opts.DependencyRequeueInterval
142142

143143
if r.features == nil {
144-
r.features = map[string]bool{}
145-
}
146-
147-
// Check and enable gated features.
148-
if oc, _ := features.Enabled(features.OptimizedGitClones); oc {
149-
r.features[features.OptimizedGitClones] = true
144+
r.features = features.FeatureGates()
150145
}
151146

152147
return ctrl.NewControllerManagedBy(mgr).

controllers/gitrepository_controller_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -727,10 +727,12 @@ func TestGitRepositoryReconciler_reconcileSource_checkoutStrategy(t *testing.T)
727727
}
728728

729729
r := &GitRepositoryReconciler{
730-
Client: fakeclient.NewClientBuilder().WithScheme(runtime.NewScheme()).Build(),
731-
EventRecorder: record.NewFakeRecorder(32),
732-
Storage: testStorage,
733-
features: features.FeatureGates(),
730+
Client: fakeclient.NewClientBuilder().WithScheme(runtime.NewScheme()).Build(),
731+
EventRecorder: record.NewFakeRecorder(32),
732+
Storage: testStorage,
733+
features: map[string]bool{
734+
features.OptimizedGitClones: true,
735+
},
734736
Libgit2TransportInitialized: transport.Enabled,
735737
}
736738

0 commit comments

Comments
 (0)