-
Notifications
You must be signed in to change notification settings - Fork 129
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(kiali-server): don't create unused ClusterRole #261
fix(kiali-server): don't create unused ClusterRole #261
Conversation
Signed-off-by: Arthur Le Roux <[email protected]>
@@ -1,3 +1,4 @@ | |||
{{- if or (.Values.deployment.view_only_mode) (ne .Values.auth.strategy "anonymous") -}} |
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.
anonymous mode can still be used with view_only_mode=true or false (in fact, I think many people use it with true, but there is no restriction).
I don't think auth.strategy setting should affect which role is created.
Can you explain the thinking behind checking for anonymous mode?
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 get your point.
The goal is to have the same behavior with the roleBinding.
So if the roleBinding is set to viewer role, the viewer role is created (same for full rights role)
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.
Ah, right. I remember this now.
@@ -1,3 +1,4 @@ | |||
{{- if not (or (.Values.deployment.view_only_mode) (ne .Values.auth.strategy "anonymous")) -}} |
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.
see my previous comment about auth.strategy.
dismissing change-request - if not anonymous, the Kiali SA will always be view-only. Only when using anonymous would the SA ever possibly be read-write
Here's a quick test to see things working. Run "helm template" with these combinations of settings - the first three should result in the
That last one will show a different behavior from the current helm chart. Because both roles are created today, that last one will result in a single "name: kiali-vewer" line (that's the Role that is created but not used). You can also examine the output of one of the first three commands to see that no Role is created with the name "kiali" that has the write permissions. A quick way to see this is to grep for "ClusterRole" and see that only one is created now with this PR, but today's helm charts create two roles: This PR results in:
but master build (today's helm chart) results in:
|
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.
lgtm. reviewed code and tested (see test procedure I used in earlier comment).
I did a quick check of the |
PR to solve kiali/kiali#7357