-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 secret selection logic for ownerRef test #7973
🐛 Fix secret selection logic for ownerRef test #7973
Conversation
/test ? |
@killianmuldoon: The following commands are available to trigger required jobs:
The following commands are available to trigger optional jobs:
Use
In response to this:
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. |
/test pull-cluster-api-e2e-full-main |
5541888
to
11435e7
Compare
11435e7
to
2eb9432
Compare
@@ -79,3 +96,12 @@ func GetOwnerGraph(namespace, kubeconfigPath string) (OwnerGraph, error) { | |||
} | |||
return owners, nil | |||
} | |||
|
|||
// isClusterSecret checks whether a Secret is related to a CAPI Cluster by checking if the secret type is ClusterSecretType. | |||
func isClusterSecret(ref corev1.ObjectReference, c client.Client) (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this locally with Kubernetes 1.20.15 and it works. I think this approach makes sense for what we're currently testing, but we might want to be careful of expectations if providers pick up this test.
2eb9432
to
8abbaf4
Compare
8abbaf4
to
4f4b730
Compare
/retest /lgtm Thx for fixing this so quickly! |
LGTM label has been added. Git tree hash: 43780247d54c0d5133e1332a19a4271cadf03e36
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer 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 |
@killianmuldoon As you mentioned it in Slack, WDYT about adding a |
@killianmuldoon sorry for getting late at this, but have you consider to use the concept of "tenant" cluster already embedded inside discovery, so we have this logic implemented in only one place? |
@fabriziopandini Sorry I already merged to get CI green again. But let's open a follow-up PR if we want to refactor. |
Opened #7976 - thanks @fabriziopandini - it's much cleaner! |
Fixes a failure in the ownerReference e2e test for Kubernetes versions below v1.24. This ensures that the secrets considered for the ownerReference test are only those directly associated with the Cluster.