-
Notifications
You must be signed in to change notification settings - Fork 23
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
api: adding role and set correct name to get CRQ #268
api: adding role and set correct name to get CRQ #268
Conversation
rchikatw
commented
Nov 12, 2024
- Adding a cluster role to get the cluster resource quota from a status reporter
- the name of CRQ is not always same as storage client so changing the logic as per the format
service/status-report/main.go
Outdated
@@ -207,7 +207,7 @@ func setClusterInformation(ctx context.Context, cl client.Client, status interfa | |||
|
|||
func setStorageQuotaUtilizationRatio(ctx context.Context, cl client.Client, status interfaces.StorageClientStatus) { | |||
clusterResourceQuota := "av1.ClusterResourceQuota{} | |||
clusterResourceQuota.Name = status.GetClientName() | |||
clusterResourceQuota.Name = fmt.Sprintf("storage-client-%s-resourceqouta", utils.GetMD5Hash(status.GetClientName())) |
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.
please use helper function to get the Name so that we will have single source of truth to generate names, if not we are going to get into the problems where we are generating names in different places with strings
- clusterresourcequotas | ||
verbs: | ||
- get | ||
- list |
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.
why do we need list access?
011821e
to
5c3ba25
Compare
@@ -166,3 +166,7 @@ func mutate(f controllerutil.MutateFn, key client.ObjectKey, obj client.Object) | |||
} | |||
return nil | |||
} | |||
|
|||
func GetClusterResourceQuotaName(name string) string { | |||
return fmt.Sprintf("storage-client-%s-resourceqouta", GetMD5Hash(name)) |
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.
typo in qouta
its quota
btw why did we need resoucequota in the name as its already ClusterResourceQuota.
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 cannot change the name of the resource right now because it has inherited from version 4.17. If I change it, I will need to conduct tests for the upgrade and some other scenarios. I will create a new task for this and work on it. Thank you for eyeing on that.
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.
@nb-ohad ^^
Signed-off-by: rchikatw <[email protected]>
5c3ba25
to
b42557f
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Madhu-1, rchikatw 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 |
284e512
into
red-hat-storage:main