I think there is a case when there are packages package1 and package2 with bundles which share the same bundle image. I think two following pieces of code (they work together) might allow upgrading from package1 to package2.
| ifsourceImage!=nil&&sourceImage.Ref!="" { |
| ifprocessed.Has(sourceImage.Ref) { |
| continue |
| } |
| processed.Insert(sourceImage.Ref) |
| ips, err:=NewInstalledPackageVariableSource(o.catalogClient, bundleDeployment.Spec.Template.Spec.Source.Image.Ref) |
| iferr!=nil { |
| returnnil, err |
| } |
| variableSources=append(variableSources, ips) |
| } |
| // find corresponding bundle for the installed content |
| resultSet:=catalogfilter.Filter(allBundles, catalogfilter.WithBundleImage(r.bundleImage)) |
| iflen(resultSet) ==0 { |
| returnnil, r.notFoundError() |
| } |
| |
| // TODO: fast follow - we should check whether we are already supporting the channel attribute in the operator spec. |
| // if so, we should take the value from spec of the operator CR in the owner ref of the bundle deployment. |
| // If that channel is set, we need to update the filter above to filter by channel as well. |
| sort.SliceStable(resultSet, func(i, jint) bool { |
| returncatalogsort.ByVersion(resultSet[i], resultSet[j]) |
| }) |
| installedBundle:=resultSet[0] |
E.g. when catalogs (single catalog or two different catalogs) have something like this:
package1 bundles:
image:tag1 - version 1.0.0
package2 bundles:
image:tag1 - version 1.0.0image:tag2 - version 1.0.1
In this case, I think, when we install package1 at version 1.0.0 and then upgrade - our installed bundle might end up being the one from package2 since we search bundes by image references. And installed bundle is driving successors.
I looked into how to mitigate this in #442 but it didn't feel like the right solutiion.
I think there is a case when there are packages
package1andpackage2with bundles which share the same bundle image. I think two following pieces of code (they work together) might allow upgrading frompackage1topackage2.operator-controller/internal/resolution/variablesources/bundle_deployment.go
Lines 43 to 53 in 7161a7b
operator-controller/internal/resolution/variablesources/installed_package.go
Lines 31 to 43 in 7161a7b
E.g. when catalogs (single catalog or two different catalogs) have something like this:
package1bundles:image:tag1- version1.0.0package2bundles:image:tag1- version1.0.0image:tag2- version1.0.1In this case, I think, when we install
package1at version1.0.0and then upgrade - our installed bundle might end up being the one frompackage2since we search bundes by image references. And installed bundle is driving successors.I looked into how to mitigate this in #442 but it didn't feel like the right solutiion.