From 7f9c5294ada2c6b39b7486413c87a5152dc2a37a Mon Sep 17 00:00:00 2001 From: Kirill Wedenin Date: Mon, 20 May 2024 12:42:52 +0200 Subject: [PATCH] copy-paste cleanup: webhook validator value `Spec.AutoDelete` VS `Spec.Durable` --- api/v1beta1/exchange_webhook.go | 2 +- api/v1beta1/queue_webhook.go | 2 +- api/v1beta1/queue_webhook_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/v1beta1/exchange_webhook.go b/api/v1beta1/exchange_webhook.go index 94a82aab..f7094cbc 100644 --- a/api/v1beta1/exchange_webhook.go +++ b/api/v1beta1/exchange_webhook.go @@ -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", )) } diff --git a/api/v1beta1/queue_webhook.go b/api/v1beta1/queue_webhook.go index b089f37a..98fe56fc 100644 --- a/api/v1beta1/queue_webhook.go +++ b/api/v1beta1/queue_webhook.go @@ -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", )) } diff --git a/api/v1beta1/queue_webhook_test.go b/api/v1beta1/queue_webhook_test.go index cb9790e2..c420ae38 100644 --- a/api/v1beta1/queue_webhook_test.go +++ b/api/v1beta1/queue_webhook_test.go @@ -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"))) })