diff --git a/controllers/operandrequest/operandrequest_controller.go b/controllers/operandrequest/operandrequest_controller.go index ef3d1b6b..2af1f715 100644 --- a/controllers/operandrequest/operandrequest_controller.go +++ b/controllers/operandrequest/operandrequest_controller.go @@ -399,7 +399,9 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error { oldObject := e.ObjectOld.(*olmv1alpha1.Subscription) newObject := e.ObjectNew.(*olmv1alpha1.Subscription) if oldObject.Labels != nil && oldObject.Labels[constant.OpreqLabel] == "true" { - return (oldObject.Status.InstalledCSV != "" && newObject.Status.InstalledCSV != "" && oldObject.Status.InstalledCSV != newObject.Status.InstalledCSV) + statusToggle := (oldObject.Status.InstalledCSV != "" && newObject.Status.InstalledCSV != "" && oldObject.Status.InstalledCSV != newObject.Status.InstalledCSV) + metadataToggle := !reflect.DeepEqual(oldObject.Annotations, newObject.Annotations) + return statusToggle || metadataToggle } return false }, diff --git a/controllers/operandrequest/reconcile_operator.go b/controllers/operandrequest/reconcile_operator.go index 8955ef75..3012ccc2 100644 --- a/controllers/operandrequest/reconcile_operator.go +++ b/controllers/operandrequest/reconcile_operator.go @@ -254,9 +254,12 @@ func (r *Reconciler) reconcileSubscription(ctx context.Context, requestInstance sub.Spec.Channel = minChannel } + channels := []string{opt.Channel} + if channels = append(channels, opt.FallbackChannels...); util.Contains(channels, sub.Spec.Channel) { + isMatchedChannel = true + } // update the spec iff channel in sub matches channel if sub.Spec.Channel == opt.Channel { - isMatchedChannel = true sub.Spec.CatalogSource = opt.SourceName sub.Spec.CatalogSourceNamespace = opt.SourceNamespace sub.Spec.Package = opt.PackageName