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

🐛 Fix gap in APIExport virtual workspace queues #2720

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

ncdc
Copy link
Member

@ncdc ncdc commented Jan 31, 2023

Summary

Fix a gap in the APIExport virtual workspace queueing where it was possible to incorrectly return a "not found" error when trying to list a claimed resource. The gap was that we weren't queueing the dependent APIExports; i.e., if APIExport A gets updated, and APIExport B has a permission claim on A's identity, we need to make sure to queue B in this situation.

Related issue(s)

Fixes #2713

Fix a gap in the APIExport virtual workspace queueing where it was
possible to incorrectly return a "not found" error when trying to list a
claimed resource. The gap was that we weren't queueing the dependent
APIExports; i.e., if APIExport A gets updated, and APIExport B has a
permission claim on A's identity, we need to make sure to queue B in
this situation.

Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
@ncdc ncdc force-pushed the fix-apiexport-vw-queue-gap branch from aa661f2 to c359931 Compare January 31, 2023 20:54
@ncdc
Copy link
Member Author

ncdc commented Jan 31, 2023

/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 31, 2023
Comment on lines -37 to -41
apiExport, ok := obj.(*apisv1alpha1.APIExport)
if !ok {
return []string{}, fmt.Errorf("obj %T is not an APIExport", obj)
}

Copy link
Member

Choose a reason for hiding this comment

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

Noticed we have these type checks present across all indexers -- are we considering dropping them everywhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we also strictly type this stuff? Why obj interface{} ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Index function

@@ -131,11 +135,16 @@ func (c *APIReconciler) reconcile(ctx context.Context, apiExport *apisv1alpha1.A
continue
}

logger = logger.WithValues("identity", pc.IdentityHash)

logger.V(4).Info("getting APIExports by identity")
Copy link
Member

Choose a reason for hiding this comment

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

Is project policy on logging that v=4 is effectively "anything goes"? Just notice a lot of messages being propagated throughout here 👍🏻

Copy link
Member Author

Choose a reason for hiding this comment

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

We can lower to 5 or 6 later, or remove them entirely, but this was critical in determining what was going on.

Copy link
Member

Choose a reason for hiding this comment

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

ack

Copy link
Member

@hasheddan hasheddan 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 31, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 31, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hasheddan, ncdc

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-merge-robot openshift-merge-robot merged commit 53fdaf5 into kcp-dev:main Jan 31, 2023
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.

bug/flake: TestAPIExportAuthorizers - APIExport view missing queueing for related APIExports (via claims)
4 participants