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

✨ Add Custom access for binding tests #3262

Closed
wants to merge 3 commits into from

Conversation

mjudeikis
Copy link
Contributor

Summary

This should work.

Related issue(s)

Fixes #

Release Notes

NONE

@kcp-ci-bot kcp-ci-bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates the PR's author has signed the DCO. labels Jan 22, 2025
@kcp-ci-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from mjudeikis. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@kcp-ci-bot kcp-ci-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 22, 2025
@mjudeikis
Copy link
Contributor Author

/test all

@mjudeikis
Copy link
Contributor Author

/test all

require.NoError(t, err, "failed to construct dynamic cluster client for server")

// create a user with custom permissions
framework.AdmitWorkspaceAccess(ctx, t, kubeClusterClient, universalPath, []string{"user"}, []string{"private-cowboys"}, true)
Copy link
Member

Choose a reason for hiding this comment

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

this creates a cluster role binding. You must use framework.Eventually below to check that the permission is effective. Maybe do some innocent call before doing the Create you want to test.

},
},
}
cowboysAPIExport, err = kcpClusterClient.Cluster(cowboysProviderPath).ApisV1alpha1().APIExports().Create(ctx, cowboysAPIExport, metav1.CreateOptions{})
Copy link
Member

Choose a reason for hiding this comment

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

this is async to become effective. You must put a framework.Eventually around the Create at the end of the test.

@kcp-ci-bot kcp-ci-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 22, 2025
@mjudeikis
Copy link
Contributor Author

/test all

@kcp-ci-bot
Copy link
Contributor

@mjudeikis: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kcp-test-e2e-multiple-runs 7545ffc link true /test pull-kcp-test-e2e-multiple-runs
pull-kcp-test-e2e-sharded 5e1e9f8 link true /test pull-kcp-test-e2e-sharded
pull-kcp-test-e2e-shared 5e1e9f8 link true /test pull-kcp-test-e2e-shared
pull-kcp-test-e2e 5e1e9f8 link true /test pull-kcp-test-e2e

Full PR test history

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. I understand the commands that are listed here.

@mjudeikis mjudeikis closed this Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has signed the DCO. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants