Skip to content

Commit

Permalink
Remove deprecated tlsCertFile from External scaler
Browse files Browse the repository at this point in the history
Signed-off-by: Rick Brouwer <[email protected]>
  • Loading branch information
rickbrouwer committed Nov 17, 2024
1 parent 8332446 commit 2dbb416
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ New deprecation(s):

### Breaking Changes

- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX))
**External Scaler**: Remove deprecated tlsCertFile from External scaler ([#4549](https://github.com/kedacore/keda/issues/4549))

### Other

Expand Down
18 changes: 0 additions & 18 deletions pkg/scalers/external_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ type externalPushScaler struct {

type externalScalerMetadata struct {
scalerAddress string
tlsCertFile string
originalMetadata map[string]string
triggerIndex int
caCert string
Expand Down Expand Up @@ -116,10 +115,6 @@ func parseExternalScalerMetadata(config *scalersconfig.ScalerConfig) (externalSc
return meta, fmt.Errorf("scaler Address is a required field")
}

if val, ok := config.TriggerMetadata["tlsCertFile"]; ok && val != "" {
meta.tlsCertFile = val
}

meta.originalMetadata = make(map[string]string)
if val, ok := config.AuthParams["caCert"]; ok {
meta.caCert = val
Expand Down Expand Up @@ -306,19 +301,6 @@ func getClientForConnectionPool(metadata externalScalerMetadata, logger logr.Log
defer connectionPoolMutex.Unlock()

buildGRPCConnection := func(metadata externalScalerMetadata) (*grpc.ClientConn, error) {
// FIXME: DEPRECATED to be removed in v2.13 https://github.com/kedacore/keda/issues/4549
if metadata.tlsCertFile != "" {
logger.V(1).Info("tlsCertFile in ScaleObject metadata will be deprecated in v2.12. Please use" +
"tlsClientCert, tlsClientKey and caCert in TriggerAuthentication instead.")
creds, err := credentials.NewClientTLSFromFile(metadata.tlsCertFile, "")
if err != nil {
return nil, err
}
return grpc.NewClient(metadata.scalerAddress,
grpc.WithDefaultServiceConfig(grpcConfig),
grpc.WithTransportCredentials(creds))
}

tlsConfig, err := util.NewTLSConfig(metadata.tlsClientCert, metadata.tlsClientKey, metadata.caCert, metadata.unsafeSsl)
if err != nil {
return nil, err
Expand Down

0 comments on commit 2dbb416

Please sign in to comment.