Skip to content

Commit

Permalink
Add feature gate for enabling fallback strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
lhp-nemlig committed Nov 22, 2024
1 parent e62f7d2 commit 7711a32
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/manifests/targetallocator/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ func ConfigMap(params Params) (*corev1.ConfigMap, error) {
} else {
taConfig["allocation_strategy"] = v1beta1.TargetAllocatorAllocationStrategyConsistentHashing
}

if featuregate.EnableTargetAllocatorFallbackStrategy.IsEnabled() {
taConfig["allocation_fallback_strategy"] = v1beta1.TargetAllocatorAllocationStrategyConsistentHashing
}

taConfig["filter_strategy"] = taSpec.FilterStrategy

if taSpec.PrometheusCR.Enabled {
Expand Down
8 changes: 8 additions & 0 deletions pkg/featuregate/featuregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ var (
featuregate.WithRegisterDescription("enables mTLS between the target allocator and the collector"),
featuregate.WithRegisterFromVersion("v0.111.0"),
)
// EnableTargetAllocatorFallbackStrategy is the feature gate that enables consistent-hashing as the fallback
// strategy for allocation strategies that might not assign all jobs (per-node).
EnableTargetAllocatorFallbackStrategy = featuregate.GlobalRegistry().MustRegister(
"operator.targetallocator.mtls",
featuregate.StageAlpha,
featuregate.WithRegisterDescription("enables fallback allocation strategy for the target allocator"),
featuregate.WithRegisterFromVersion("v0.114.0"),
)
// EnableConfigDefaulting is the feature gate that enables the operator to default the endpoint for known components.
EnableConfigDefaulting = featuregate.GlobalRegistry().MustRegister(
"operator.collector.default.config",
Expand Down

0 comments on commit 7711a32

Please sign in to comment.