Skip to content
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

Snapshot Fix for Deprecation Info #3149

Conversation

dtfranz
Copy link
Contributor

@dtfranz dtfranz commented Jan 5, 2024

When initially implemented, in order to retrieve deprecation metadata the subscription resolver was modified to add an optional sourceProvider and we incorrectly used the aggregate OperatorGroupToggleSourceProvider. This resulted in errors when taking snapshots from namespaces in which no OperatorGroups were present.

To fix, we just use the RegistrySourceProvider directly instead of the aggregate which is what we actually needed in the first place. This results in silencing the errors mentioned above and also resolves an issue where the deprecation info will not be added to Subscription status when the CatalogSource's namespace does not contain an OperatorGroup.

Copy link
Contributor

@tmshort tmshort left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 8, 2024
Copy link

openshift-ci bot commented Jan 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dtfranz, tmshort

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 8, 2024
@@ -346,7 +346,7 @@ func NewOperator(ctx context.Context, kubeconfigPath string, clock utilclock.Clo
subscription.WithAppendedReconcilers(subscription.ReconcilerFromLegacySyncHandler(op.syncSubscriptions, nil)),
subscription.WithRegistryReconcilerFactory(op.reconciler),
subscription.WithGlobalCatalogNamespace(op.namespace),
subscription.WithSourceProvider(resolverSourceProvider),
subscription.WithSourceProvider(op.sourceInvalidator),
Copy link
Member

Choose a reason for hiding this comment

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

So just to clarify, we needed the list of catalogSources in b9638dc and we just used the wrong source provider?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's right, the OperatorGroupToggleSourceProvider (from what I understand) is essentially a filter which allows users to exclude global catalogs from resolution. But I don't believe that this sourceProvider was intended to be used when taking cache snapshots of the CatalogSource namespace, instead it's used to allow for instance a user to ignore a Catalog update by adding an annotation to the OperatorGroup of a separate namespace in which their operator is installed.

In OCP deployments, the openshift-marketplace namespace doesn't have an OperatorGroup, so if you use this source provider it will error out when taking snapshots and give you nothing back.

Copy link
Member

Choose a reason for hiding this comment

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

Ah got it, thanks Daniel!

@dtfranz
Copy link
Contributor Author

dtfranz commented Jan 8, 2024

Any idea what's going on with tide? I haven't seen this before:
tide Pending — Not mergeable. No Tide query for branch master found.

@tmshort
Copy link
Contributor

tmshort commented Jan 8, 2024

Any idea what's going on with tide? I haven't seen this before: tide Pending — Not mergeable. No Tide query for branch master found.

It's disabled for the master branch. It's fine to merge.

@tmshort tmshort added this pull request to the merge queue Jan 8, 2024
Merged via the queue into operator-framework:master with commit 8eb16f7 Jan 8, 2024
15 of 16 checks passed
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.

3 participants