From 4ca51942ea2d82f2119824cc5a7206e91de4f77f Mon Sep 17 00:00:00 2001 From: Ryan Emerson Date: Tue, 21 May 2024 17:04:03 +0100 Subject: [PATCH] Add Operand version to DeprecatedOperandVersion event --- api/v1/infinispan_webhook.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/v1/infinispan_webhook.go b/api/v1/infinispan_webhook.go index c99e4f2c4..29e8aae29 100644 --- a/api/v1/infinispan_webhook.go +++ b/api/v1/infinispan_webhook.go @@ -241,9 +241,9 @@ func (i *Infinispan) validate() error { operand, err := versionManager.WithRef(i.Spec.Version) if err != nil { allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("version"), i.Spec.Version, err.Error())) - } - if operand.Deprecated { - eventRec.Event(i, corev1.EventTypeWarning, "DeprecatedOperandVersion", "Configured Infinispan version will be removed in a subsequent Operator release. You must upgrade to a non-deprecated release before upgrading the Operator.") + } else if operand.Deprecated { + msg := fmt.Sprintf("Infinispan version '%s' will be removed in a subsequent Operator release. You must upgrade to a non-deprecated release before upgrading the Operator.", i.Spec.Version) + eventRec.Event(i, corev1.EventTypeWarning, "DeprecatedOperandVersion", msg) } if i.Spec.Container.CPU != "" {