Skip to content

Commit

Permalink
refactor(rmq): make conditional match error string (#3725)
Browse files Browse the repository at this point in the history
Translated in a sentence, the conditional statement would match "if
excludeUnacknowledged is set and the protocol used is equal to amqp"
instead of "if excludeUnacknowledged is set and the protocol used is
different then http"

Signed-off-by: Theo Bob Massard <[email protected]>
  • Loading branch information
tbobm authored Oct 10, 2022
1 parent b599aa9 commit b7f8ebf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/scalers/rabbitmq_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ func parseRabbitMQMetadata(config *ScalerConfig) (*rabbitMQMetadata, error) {
return nil, err
}

if meta.useRegex && meta.protocol == amqpProtocol {
if meta.useRegex && meta.protocol != httpProtocol {
return nil, fmt.Errorf("configure only useRegex with http protocol")
}

if meta.excludeUnacknowledged && meta.protocol == amqpProtocol {
if meta.excludeUnacknowledged && meta.protocol != httpProtocol {
return nil, fmt.Errorf("configure excludeUnacknowledged=true with http protocol only")
}

Expand Down

0 comments on commit b7f8ebf

Please sign in to comment.