-
Notifications
You must be signed in to change notification settings - Fork 92
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
redpanda: convert rbac.yaml to go code #1344
Conversation
|
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.
Thank you for contribution. Let me know if you need more help.
Could you run go test ./charts/redpanda -short -update
to update charts/redpanda/testdata/ci
files.
charts/redpanda/templates/rbac.yaml
Outdated
{{- $crs := (get ((include "redpanda.ClusterRoles" (dict "a" (list .))) | fromJson) "r") }} | ||
{{- range $_, $cr := $crs }} |
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.
Can the range
cover all cases without calling each function separately?
From 6 function calls it could be reduced to 4:
- ClusterRole
- ClusterRoleBinding
- Role
- RoleBinding
In the go code it would be easier to reason about, than template langue.
charts/redpanda/values.go
Outdated
@@ -388,6 +388,7 @@ type Statefulset struct { | |||
Repository string `json:"repository" jsonschema:"required,default=docker.redpanda.com/redpandadata/redpanda-operator"` | |||
} `json:"image"` | |||
Enabled bool `json:"enabled"` | |||
CreateRBAC bool `json:"createRbac"` |
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.
CreateRBAC bool `json:"createRbac"` | |
CreateRBAC bool `json:"createRBAC"` |
charts/redpanda/templates/rbac.yaml
Outdated
name: {{ include "redpanda.serviceAccountName" . }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
{{- end }} | ||
{{toYaml $scr}} |
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.
{{toYaml $scr}} | |
{{toYaml $scrb}} |
- get | ||
- list | ||
{{- $crs := (get ((include "redpanda.ClusterRoles" (dict "a" (list .))) | fromJson) "r") }} | ||
{{- range $_, $cr := $crs }} | ||
--- |
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'm not sure why, but each usage of ---
render incorrectly. It should be in it's own new line, but it is concatenated to the last line of the object.
@charlie-haley Thank you for contribution. I adjusted your change. |
This PR converts
rbac.yaml
to Go code usinggotohelm
.Fixes #1213