Skip to content

Commit

Permalink
Add Operand version to DeprecatedOperandVersion event
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanemerson committed May 22, 2024
1 parent 957c8b8 commit 4ca5194
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/v1/infinispan_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down

0 comments on commit 4ca5194

Please sign in to comment.