Skip to content

Commit 7f9c529

Browse files
committed
copy-paste cleanup: webhook validator value Spec.AutoDelete VS Spec.Durable
1 parent 70bf6d8 commit 7f9c529

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)