Skip to content

Commit

Permalink
remove unused leader election parameters of metrics adapter (#5986)
Browse files Browse the repository at this point in the history
Signed-off-by: lanting.chiang <lanting.chiang@robinhood.com>
  • Loading branch information
lantingchiang authored Jul 30, 2024
1 parent fec0756 commit 03b6b83
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio
- **General**: Introduce new Splunk Scaler ([#5904](https://github.com/kedacore/keda/issues/5904))
- **General**: Provide CloudEvents around the management of ScaledObjects resources ([#3522](https://github.com/kedacore/keda/issues/3522))
- **General**: Remove deprecated Kustomize commonLabels ([#5888](https://github.com/kedacore/keda/pull/5888))
- **General**: Remove unused leader election parameters in metrics adapter ([#5959](https://github.com/kedacore/keda/issues/5959))
- **General**: Support for Kubernetes v1.30 ([#5828](https://github.com/kedacore/keda/issues/5828))

#### Experimental
Expand Down
21 changes: 0 additions & 21 deletions cmd/adapter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,6 @@ func (a *Adapter) makeProvider(ctx context.Context) (provider.ExternalMetricsPro
return nil, nil, fmt.Errorf("failed to get watch namespace (%s)", err)
}

leaseDuration, err := kedautil.ResolveOsEnvDuration("KEDA_METRICS_LEADER_ELECTION_LEASE_DURATION")
if err != nil {
logger.Error(err, "invalid KEDA_METRICS_LEADER_ELECTION_LEASE_DURATION")
return nil, nil, fmt.Errorf("invalid KEDA_METRICS_LEADER_ELECTION_LEASE_DURATION (%s)", err)
}

renewDeadline, err := kedautil.ResolveOsEnvDuration("KEDA_METRICS_LEADER_ELECTION_RENEW_DEADLINE")
if err != nil {
logger.Error(err, "Invalid KEDA_METRICS_LEADER_ELECTION_RENEW_DEADLINE")
return nil, nil, fmt.Errorf("invalid KEDA_METRICS_LEADER_ELECTION_RENEW_DEADLINE (%s)", err)
}

retryPeriod, err := kedautil.ResolveOsEnvDuration("KEDA_METRICS_LEADER_ELECTION_RETRY_PERIOD")
if err != nil {
logger.Error(err, "Invalid KEDA_METRICS_LEADER_ELECTION_RETRY_PERIOD")
return nil, nil, fmt.Errorf("invalid KEDA_METRICS_LEADER_ELECTION_RETRY_PERIOD (%s)", err)
}

// Get a config to talk to the apiserver
cfg := ctrl.GetConfigOrDie()
cfg.QPS = adapterClientRequestQPS
Expand All @@ -121,9 +103,6 @@ func (a *Adapter) makeProvider(ctx context.Context) (provider.ExternalMetricsPro
DefaultNamespaces: namespaces,
},
PprofBindAddress: profilingAddr,
LeaseDuration: leaseDuration,
RenewDeadline: renewDeadline,
RetryPeriod: retryPeriod,
})
if err != nil {
logger.Error(err, "failed to setup manager")
Expand Down

0 comments on commit 03b6b83

Please sign in to comment.