Skip to content

Commit 7711a32

Browse files
committed
Add feature gate for enabling fallback strategy
1 parent e62f7d2 commit 7711a32

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

internal/manifests/targetallocator/configmap.go

+5
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ func ConfigMap(params Params) (*corev1.ConfigMap, error) {
9090
} else {
9191
taConfig["allocation_strategy"] = v1beta1.TargetAllocatorAllocationStrategyConsistentHashing
9292
}
93+
94+
if featuregate.EnableTargetAllocatorFallbackStrategy.IsEnabled() {
95+
taConfig["allocation_fallback_strategy"] = v1beta1.TargetAllocatorAllocationStrategyConsistentHashing
96+
}
97+
9398
taConfig["filter_strategy"] = taSpec.FilterStrategy
9499

95100
if taSpec.PrometheusCR.Enabled {

pkg/featuregate/featuregate.go

+8
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ var (
6767
featuregate.WithRegisterDescription("enables mTLS between the target allocator and the collector"),
6868
featuregate.WithRegisterFromVersion("v0.111.0"),
6969
)
70+
// EnableTargetAllocatorFallbackStrategy is the feature gate that enables consistent-hashing as the fallback
71+
// strategy for allocation strategies that might not assign all jobs (per-node).
72+
EnableTargetAllocatorFallbackStrategy = featuregate.GlobalRegistry().MustRegister(
73+
"operator.targetallocator.mtls",
74+
featuregate.StageAlpha,
75+
featuregate.WithRegisterDescription("enables fallback allocation strategy for the target allocator"),
76+
featuregate.WithRegisterFromVersion("v0.114.0"),
77+
)
7078
// EnableConfigDefaulting is the feature gate that enables the operator to default the endpoint for known components.
7179
EnableConfigDefaulting = featuregate.GlobalRegistry().MustRegister(
7280
"operator.collector.default.config",

0 commit comments

Comments
 (0)