Skip to content

Translate legacy "bundle dependencies" to properties. #2254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

benluddy
Copy link
Contributor

Operator dependencies are expressed as properties, but there was
initially a notion of dependencies as distinct from properties. For
that reason, catalog-operator must support existing catalog images
that serve separate Bundle.dependencies and Bundle.properties fields
by translating the three legacy dependency types (olm.label,
olm.package, and olm.gvk) into their corresponding properties.

Operator dependencies are expressed as properties, but there was
initially a notion of dependencies as distinct from properties. For
that reason, catalog-operator must support existing catalog images
that serve separate Bundle.dependencies and Bundle.properties fields
by translating the three legacy dependency types (olm.label,
olm.package, and olm.gvk) into their corresponding properties.

Signed-off-by: Ben Luddy <[email protected]>
@benluddy benluddy requested a review from ecordell July 13, 2021 20:07
@openshift-ci
Copy link

openshift-ci bot commented Jul 13, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: benluddy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot requested review from awgreene and kevinrizza July 13, 2021 20:07
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 13, 2021
Copy link
Member

@ecordell ecordell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of small comments, otherwise looks good.

This change makes me think we want to prioritize a story for "property-only" updates of operators. I think we would want to have existing CSVs get these annotations added to them without any other changes. (and there are other reasons we might want that too with declarative config)

The main blocker for that is just identity - but I think we could probably pick the the properties we use for identity today (package, name, version, channel) and use that as the identifier and potentially work on something a bit more solid in the future.

Value: i,
}
}
var l, r []Property
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some other places deduplicate properties (which would make this a map). Did we write down anything about multiple properties with the same exact content?

if err != nil {
return nil, err
}
properties = append(properties, ps...)
}

// legacy support - if the grpc api doesn't contain required/provided apis, fallback to csv parsing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to remove this now? I think this has the same backport range as the rest of the PR

if err != nil {
return nil, err
}
namespacedCache := r.cache.Namespaced(namespaces...).WithExistingOperators(existingSnapshot)

_, existingInstallables, err := r.getBundleInstallables(registry.NewVirtualCatalogKey(namespaces[0]), existingSnapshot.Find(), namespacedCache, visited)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 this refactoring makes more sense

@ecordell
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 14, 2021
@openshift-merge-robot openshift-merge-robot merged commit 4ffa5c1 into operator-framework:master Jul 14, 2021
@kevinrizza
Copy link
Member

/cherry-pick release-4.7

@openshift-cherrypick-robot

@kevinrizza: new pull request created: #2328

In response to this:

/cherry-pick release-4.7

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants