Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion controllers/operandrequest/operandrequest_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
5 changes: 4 additions & 1 deletion controllers/operandrequest/reconcile_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down