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

[EV-5126] Rename and update tigera-crds clusterrole #3458

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

ti-afra
Copy link
Contributor

@ti-afra ti-afra commented Aug 12, 2024

Changes:

  1. Rename "tigera-crds" clusterrole to "tigera-apiserver"
  2. Add "authorizationreviews" rbac to "tigera-apiserver" clusterrole; queryserver needs this rbac to return authorized list of items in the resultset.
  3. Rename "tigera-apiserver-access-tigera-crds" clusterrolebinding to "tiger-apiserver"

Description

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

@ti-afra ti-afra requested a review from a team as a code owner August 12, 2024 16:47
@marvin-tigera marvin-tigera added this to the v1.36.0 milestone Aug 12, 2024
@ti-afra ti-afra changed the title Rename and update tigera-crds clusterrole [EV-5126] Rename and update tigera-crds clusterrole Aug 13, 2024
@@ -1906,3 +1914,25 @@ func (c *apiServerComponent) multiTenantManagedClusterAccessClusterRoles() []cli

return objects
}

func (c *apiServerComponent) getDeprecatedResources() []client.Object {
renamedRscList := []client.Object{}
Copy link
Member

Choose a reason for hiding this comment

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

nit: it could be replaced with empty slice declaration:

var renamedRscList []client.Object

@@ -279,6 +279,9 @@ func (c *apiServerComponent) Objects() ([]client.Object, []client.Object) {
// Explicitly delete any global OSS objects.
// Namespaced objects will be handled by namespace deletion.
objsToDelete = append(objsToDelete, globalCalicoObjects...)

// Explicitly delete any renamed/deprecated objects.
objsToDelete = append(objsToDelete, c.getDeprecatedResources()...)
Copy link
Member

Choose a reason for hiding this comment

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

I think this can be outside (under) the if-else statement. This always needs to get deleted, regardless of whether the cluster is enterprise right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved it outside, but for opensource we dont have the "tigera-crds" clusterrole and the apiserver binding. Doesn't it matter or wouldn't it fail if they dont exist?

@@ -1258,26 +1261,31 @@ func (c *apiServerComponent) tigeraCustomResourcesClusterRole() *rbacv1.ClusterR
"patch",
},
},
{
Copy link
Member

Choose a reason for hiding this comment

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

Please if you could add a comment as to why we need this permission, it will help us track over time why we added permissions and also make it easier to remove unused permissions.

@ti-afra ti-afra force-pushed the apiserver-rbac branch 2 times, most recently from 7437633 to 7b9e125 Compare August 14, 2024 20:28
Copy link
Member

@rene-dekker rene-dekker left a comment

Choose a reason for hiding this comment

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

lgtm

…o it

Changes:
1. Rename "tigera-crds" clusterrole to "tigera-apiserver"
2. Add "authorizationreviews" rbac to "tigera-apiserver" clusterrole;
queryserver needs this rbac to return authorized list of items in the resultset.
3. Rename "tigera-apiserver-access-tigera-crds" clusterrolebinding to "tiger-apiserver"
@rene-dekker rene-dekker merged commit 02c964a into tigera:master Aug 14, 2024
5 checks passed
@ti-afra ti-afra deleted the apiserver-rbac branch August 16, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants