Skip to content

Commit

Permalink
Merge pull request #13 from joelsmith/main
Browse files Browse the repository at this point in the history
OCPBUGS-15274: Check for "none" when checking pod identity provider
  • Loading branch information
openshift-merge-robot authored Jun 29, 2023
2 parents 4ee2831 + a494fcb commit 341640b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/scalers/prometheus_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,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 @@ -227,7 +228,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 341640b

Please sign in to comment.