Skip to content

Commit ddd8d8e

Browse files
authored
Merge pull request #823 from pafmaf/fix/exchange-webhook-validator-interface
minor cleanup: `Spec.AutoDelete` VS `Spec.Durable`
2 parents 7351d23 + 7f9c529 commit ddd8d8e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

api/v1beta1/exchange_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (e *Exchange) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Obje
8383
if newExchange.Spec.Durable != oldExchange.Spec.Durable {
8484
allErrs = append(allErrs, field.Invalid(
8585
field.NewPath("spec", "durable"),
86-
newExchange.Spec.AutoDelete,
86+
newExchange.Spec.Durable,
8787
"durable cannot be updated",
8888
))
8989
}

api/v1beta1/queue_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (q *Queue) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object)
8989
if newQueue.Spec.Durable != oldQueue.Spec.Durable {
9090
allErrs = append(allErrs, field.Invalid(
9191
field.NewPath("spec", "durable"),
92-
newQueue.Spec.AutoDelete,
92+
newQueue.Spec.Durable,
9393
"durable cannot be updated",
9494
))
9595
}

api/v1beta1/queue_webhook_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var _ = Describe("queue webhook", func() {
5151

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

0 commit comments

Comments
 (0)