Skip to content

Possibility of an upgrade from one package to another #466

Closed
@m1kola

Description

@m1kola

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.

if sourceImage != nil && sourceImage.Ref != "" {
if processed.Has(sourceImage.Ref) {
continue
}
processed.Insert(sourceImage.Ref)
ips, err := NewInstalledPackageVariableSource(o.catalogClient, bundleDeployment.Spec.Template.Spec.Source.Image.Ref)
if err != nil {
return nil, err
}
variableSources = append(variableSources, ips)
}

// find corresponding bundle for the installed content
resultSet := catalogfilter.Filter(allBundles, catalogfilter.WithBundleImage(r.bundleImage))
if len(resultSet) == 0 {
return nil, 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, j int) bool {
return catalogsort.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.0
  • image: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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions