Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit800dd9c

Browse files
fix: fix incorrect rendering of RBAC in Helm chart when workspacePerm… (#20596)
## DescriptionCherry Pick commit of#20569 for@rowansmithauCo-authored-by: Rowan Smith <rowan@coder.com>
1 parent035ad33 commit800dd9c

File tree

3 files changed

+4
-88
lines changed

3 files changed

+4
-88
lines changed

‎helm/coder/tests/testdata/namespace_rbac.golden‎

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -117,34 +117,6 @@ rules:
117117
# Source: coder/templates/rbac.yaml
118118
apiVersion: rbac.authorization.k8s.io/v1
119119
kind: Role
120-
metadata:
121-
name: coder-workspace-perms
122-
namespace: test-namespace2
123-
rules:
124-
- apiGroups:
125-
- apps
126-
resources:
127-
- deployments
128-
verbs:
129-
- create
130-
- delete
131-
- deletecollection
132-
- get
133-
- list
134-
- patch
135-
- update
136-
- watch
137-
- apiGroups:
138-
- networking.k8s.io
139-
resources:
140-
- ingresses
141-
verbs:
142-
- get
143-
- list
144-
---
145-
# Source: coder/templates/rbac.yaml
146-
apiVersion: rbac.authorization.k8s.io/v1
147-
kind: Role
148120
metadata:
149121
name: coder-workspace-perms
150122
namespace: test-namespace3
@@ -262,21 +234,6 @@ roleRef:
262234
# Source: coder/templates/rbac.yaml
263235
apiVersion: rbac.authorization.k8s.io/v1
264236
kind: RoleBinding
265-
metadata:
266-
name: "coder"
267-
namespace: test-namespace2
268-
subjects:
269-
- kind: ServiceAccount
270-
name: "coder"
271-
namespace: default
272-
roleRef:
273-
apiGroup: rbac.authorization.k8s.io
274-
kind: Role
275-
name: coder-workspace-perms
276-
---
277-
# Source: coder/templates/rbac.yaml
278-
apiVersion: rbac.authorization.k8s.io/v1
279-
kind: RoleBinding
280237
metadata:
281238
name: "coder"
282239
namespace: test-namespace3

‎helm/coder/tests/testdata/namespace_rbac_coder.golden‎

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -117,34 +117,6 @@ rules:
117117
# Source: coder/templates/rbac.yaml
118118
apiVersion: rbac.authorization.k8s.io/v1
119119
kind: Role
120-
metadata:
121-
name: coder-workspace-perms
122-
namespace: test-namespace2
123-
rules:
124-
- apiGroups:
125-
- apps
126-
resources:
127-
- deployments
128-
verbs:
129-
- create
130-
- delete
131-
- deletecollection
132-
- get
133-
- list
134-
- patch
135-
- update
136-
- watch
137-
- apiGroups:
138-
- networking.k8s.io
139-
resources:
140-
- ingresses
141-
verbs:
142-
- get
143-
- list
144-
---
145-
# Source: coder/templates/rbac.yaml
146-
apiVersion: rbac.authorization.k8s.io/v1
147-
kind: Role
148120
metadata:
149121
name: coder-workspace-perms
150122
namespace: test-namespace3
@@ -262,21 +234,6 @@ roleRef:
262234
# Source: coder/templates/rbac.yaml
263235
apiVersion: rbac.authorization.k8s.io/v1
264236
kind: RoleBinding
265-
metadata:
266-
name: "coder"
267-
namespace: test-namespace2
268-
subjects:
269-
- kind: ServiceAccount
270-
name: "coder"
271-
namespace: coder
272-
roleRef:
273-
apiGroup: rbac.authorization.k8s.io
274-
kind: Role
275-
name: coder-workspace-perms
276-
---
277-
# Source: coder/templates/rbac.yaml
278-
apiVersion: rbac.authorization.k8s.io/v1
279-
kind: RoleBinding
280237
metadata:
281238
name: "coder"
282239
namespace: test-namespace3

‎helm/libcoder/templates/_rbac.yaml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{{- define "libcoder.rbac.forNamespace" -}}
22
{{- $nsPerms := ternary .workspacePerms .Top.Values.coder.serviceAccount.workspacePerms (hasKey . "workspacePerms") -}}
3-
{{- $nsDeploy := ternary .enableDeployments .Top.Values.coder.serviceAccount.enableDeployments (hasKey . "enableDeployments") -}}
4-
{{- $nsExtra := ternary .extraRules .Top.Values.coder.serviceAccount.extraRules (hasKey . "extraRules") -}}
3+
{{- $nsDeployRaw := ternary .enableDeployments .Top.Values.coder.serviceAccount.enableDeployments (hasKey . "enableDeployments") -}}
4+
{{- $nsExtraRaw := ternary .extraRules .Top.Values.coder.serviceAccount.extraRules (hasKey . "extraRules") -}}
5+
{{- $nsDeploy := and $nsPerms $nsDeployRaw -}}
6+
{{- $nsExtra := ternary $nsExtraRaw (list) $nsPerms -}}
57

68
{{- if or $nsPerms (or $nsDeploy $nsExtra) }}
79
---

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp