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

Set creator principal id annotation when creating projects and v3 clusters #12233

Merged
merged 5 commits into from
Oct 15, 2024

Conversation

mantis-toboggan-md
Copy link
Member

@mantis-toboggan-md mantis-toboggan-md commented Oct 11, 2024

Summary

Fixes #11852

Occurred changes and/or fixed issues

This PR adds an annotation to projects and v3 clusters when using third-party auth. There is a corresponding ember PR which covers rke1 clusters and importing aks/eks/gke clusters

Areas or cases that should be tested

Using local auth, verify that no principal id annotation is set when creating projects and aks/eks/gke clusters. Using third party auth, verify that the field.cattle.io/creator-principal-name is set when creating projects and aks/eks/gke clusters.

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

@@ -103,6 +103,9 @@ export default {
this.value.metadata['namespace'] = this.$store.getters['currentCluster'].id;
this.value['spec'] = this.value.spec || {};
this.value.spec['containerDefaultResourceLimit'] = this.value.spec.containerDefaultResourceLimit || {};
if (!this.$store.getters['auth/principalId'].includes('local://')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

it might make sense to add a utility or a getter to check isPrincipalIdLocal.

codyrancher
codyrancher previously approved these changes Oct 11, 2024
Copy link
Contributor

@codyrancher codyrancher left a comment

Choose a reason for hiding this comment

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

As always, thanks for being through with the tests.

yonasberhe23
yonasberhe23 previously approved these changes Oct 11, 2024
@mantis-toboggan-md mantis-toboggan-md merged commit 0f723dd into rancher:master Oct 15, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Respect creator's principal ID when creating projects & clusters
3 participants