Skip to content

Commit

Permalink
Return the error if TLS config fails in Rabbitmq scaler (#5964)
Browse files Browse the repository at this point in the history
Signed-off-by: semihbkgr <buyukgungorsemih@gmail.com>
  • Loading branch information
semihbkgr authored Jul 22, 2024
1 parent 817821f commit bb53516
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/scalers/rabbitmq_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,10 @@ func getConnectionAndChannel(host string, meta *rabbitMQMetadata) (*amqp.Connect
var err error
if meta.enableTLS {
tlsConfig, configErr := kedautil.NewTLSConfigWithPassword(meta.cert, meta.key, meta.keyPassword, meta.ca, meta.unsafeSsl)
if configErr == nil {
conn, err = amqp.DialTLS(host, tlsConfig)
if configErr != nil {
return nil, nil, configErr
}
conn, err = amqp.DialTLS(host, tlsConfig)
} else {
conn, err = amqp.Dial(host)
}
Expand Down

0 comments on commit bb53516

Please sign in to comment.