Skip to content

Commit

Permalink
Merge pull request #823 from pafmaf/fix/exchange-webhook-validator-in…
Browse files Browse the repository at this point in the history
…terface

minor cleanup: `Spec.AutoDelete` VS `Spec.Durable`
  • Loading branch information
Zerpet authored May 21, 2024
2 parents 7351d23 + 7f9c529 commit ddd8d8e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/v1beta1/exchange_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (e *Exchange) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Obje
if newExchange.Spec.Durable != oldExchange.Spec.Durable {
allErrs = append(allErrs, field.Invalid(
field.NewPath("spec", "durable"),
newExchange.Spec.AutoDelete,
newExchange.Spec.Durable,
"durable cannot be updated",
))
}
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/queue_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (q *Queue) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object)
if newQueue.Spec.Durable != oldQueue.Spec.Durable {
allErrs = append(allErrs, field.Invalid(
field.NewPath("spec", "durable"),
newQueue.Spec.AutoDelete,
newQueue.Spec.Durable,
"durable cannot be updated",
))
}
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/queue_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var _ = Describe("queue webhook", func() {

It("does not allow non-durable quorum queues", func() {
notAllowedQ := queue.DeepCopy()
notAllowedQ.Spec.AutoDelete = false
notAllowedQ.Spec.Durable = false
_, err := notAllowedQ.ValidateCreate(rootCtx, notAllowedQ)
Expect(err).To(MatchError(ContainSubstring("Quorum queues must have durable set to true")))
})
Expand Down

0 comments on commit ddd8d8e

Please sign in to comment.