Skip to content

Commit

Permalink
Bug: Check for "none" when checking pod identity provider (kedacore#4748
Browse files Browse the repository at this point in the history
)

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
  • Loading branch information
joelsmith authored and JorTurFer committed Jun 29, 2023
1 parent 62d90e8 commit 3ac772a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio

- **General**: Paused ScaledObject continues working after removing the annotation ([#4733](https://github.com/kedacore/keda/issues/4733))
- **General**: Skip resolving secrets if namespace is restricted ([#4519](https://github.com/kedacore/keda/issues/4519))
- **Prometheus**: Authenticated connections to Prometheus work in non-PodIdenty case ([#4695](https://github.com/kedacore/keda/issues/4695))

### Deprecations

Expand Down
3 changes: 2 additions & 1 deletion pkg/scalers/prometheus_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
v2 "k8s.io/api/autoscaling/v2"
"k8s.io/metrics/pkg/apis/external_metrics"

kedav1alpha1 "github.com/kedacore/keda/v2/apis/keda/v1alpha1"
"github.com/kedacore/keda/v2/pkg/scalers/authentication"
"github.com/kedacore/keda/v2/pkg/scalers/azure"
kedautil "github.com/kedacore/keda/v2/pkg/util"
Expand Down Expand Up @@ -237,7 +238,7 @@ func parseAuthConfig(config *ScalerConfig, meta *prometheusMetadata) error {
return err
}

if auth != nil && config.PodIdentity.Provider != "" {
if auth != nil && !(config.PodIdentity.Provider == kedav1alpha1.PodIdentityProviderNone || config.PodIdentity.Provider == "") {
return fmt.Errorf("pod identity cannot be enabled with other auth types")
}
meta.prometheusAuth = auth
Expand Down

0 comments on commit 3ac772a

Please sign in to comment.