diff --git a/internal/controllers/clusterextension_controller.go b/internal/controllers/clusterextension_controller.go index 2c4cf69ed..0a0ac5233 100644 --- a/internal/controllers/clusterextension_controller.go +++ b/internal/controllers/clusterextension_controller.go @@ -306,11 +306,15 @@ func SetDeprecationStatus(ext *ocv1alpha1.ClusterExtension, bundle *catalogmetad }) } - // Even if the bundle is not deprecated, there may be channel - // deprecations associated with this bundle. If there are we need - // verify if it matches the channel specified in the ClusterExtension. - // if the bundle is not deprecated and there is no channel specified - // in the ClusterExtension there is no deprecations to be applied. + // There are two early return scenarios here: + // 1) The bundle is not deprecated (i.e no package or bundle deprecations) + // AND there are no other deprecations associated with the bundle + // 2) The bundle is not deprecated, there are deprecations associated + // with the bundle (i.e at least one channel the bundle is present in is deprecated), + // and the ClusterExtension does not specify a channel. This is because the channel deprecations + // are a loose deprecation coupling on the bundle. A ClusterExtension installation is only + // considered deprecated by a channel deprecation when a deprecated channel is specified via + // the spec.channel field. if (!bundle.IsDeprecated() && !bundle.HasDeprecation()) || (!bundle.IsDeprecated() && ext.Spec.Channel == "") { return }