Skip to content

Commit bfceb66

Browse files
Fix/configurable clusterrole binding name (#443)
* build(deps): bump golang.org/x/mod from 0.22.0 to 0.23.0 Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.22.0 to 0.23.0. - [Commits](golang/mod@v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/mod dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): bump github.com/fluxcd/pkg/apis/meta from 1.6.1 to 1.10.0 Bumps [github.com/fluxcd/pkg/apis/meta](https://github.com/fluxcd/pkg) from 1.6.1 to 1.10.0. - [Commits](fluxcd/pkg@apis/meta/v1.6.1...apis/meta/v1.10.0) --- updated-dependencies: - dependency-name: github.com/fluxcd/pkg/apis/meta dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * go mod tidy * expose clusterrolebinding name for fluxcd and kraan admin service accounts * Revert "build(deps): bump github.com/fluxcd/pkg/apis/meta from 1.6.1 to 1.10.0" This reverts commit 4bc19f9. --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 5f2bcc5 commit bfceb66

File tree

8 files changed

+21
-8
lines changed

8 files changed

+21
-8
lines changed

Diff for: VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.3.45
1+
v0.3.46

Diff for: chart/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
description: A Helm chart for kraan controller
33
name: kraan-controller
44
type: application
5-
appVersion: v0.3.45
6-
version: v0.3.45
5+
appVersion: v0.3.46
6+
version: v0.3.46

Diff for: chart/templates/_helpers.tpl

+9
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,12 @@ Create chart name and version as used by the chart label.
3030
{{- define "kraan-controller.chart" -}}
3131
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
3232
{{- end -}}
33+
34+
{{- define "kraan-controller.gotk.adminClusterRoleBinding.name" -}}
35+
{{ $crbName := .Values.gotk.rbac.adminClusterRoleBinding.name }}
36+
{{- if eq $crbName "cluster-reconciler" -}}
37+
{{ $crbName }}-{{ .Release.Namespace }}
38+
{{- else -}}
39+
{{ $crbName }}
40+
{{- end -}}
41+
{{- end -}}

Diff for: chart/templates/gotk/rbac.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ metadata:
149149
labels:
150150
app.kubernetes.io/instance: "{{ .Release.Namespace }}"
151151
app.kubernetes.io/version: latest
152-
name: cluster-reconciler-{{.Release.Namespace}}
152+
name: {{ template "kraan-controller.gotk.adminClusterRoleBinding.name" . }}
153153
roleRef:
154154
apiGroup: rbac.authorization.k8s.io
155155
kind: ClusterRole

Diff for: chart/templates/kraan/rbac.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ subjects:
152152
apiVersion: rbac.authorization.k8s.io/v1
153153
kind: ClusterRoleBinding
154154
metadata:
155-
name: kraan-deployer
155+
name: {{ .Values.kraan.rbac.adminClusterRoleBinding.name }}
156156
roleRef:
157157
apiGroup: rbac.authorization.k8s.io
158158
kind: ClusterRole

Diff for: chart/values.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ kraan:
2222
# specify rules to create a ClusterRole
2323
# https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#policyrule-v1-rbac-authorization-k8s-io
2424
rules: []
25+
adminClusterRoleBinding:
26+
name: "kraan-deployer"
2527
netpolicy:
2628
enabled: true
2729
kraanController:
@@ -93,6 +95,8 @@ gotk:
9395
# specify rules to create a ClusterRole
9496
# https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#policyrule-v1-rbac-authorization-k8s-io
9597
rules: []
98+
adminClusterRoleBinding:
99+
name: "cluster-reconciler"
96100
netpolicy:
97101
enabled: true
98102

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
github.com/pkg/errors v0.9.1
1717
github.com/prometheus/client_golang v1.20.5
1818
go.uber.org/zap v1.27.0
19-
golang.org/x/mod v0.22.0
19+
golang.org/x/mod v0.23.0
2020
k8s.io/api v0.31.1
2121
k8s.io/apiextensions-apiserver v0.31.1
2222
k8s.io/apimachinery v0.31.1

Diff for: go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl
229229
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
230230
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
231231
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
232-
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
233-
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
232+
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
233+
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
234234
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
235235
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
236236
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=

0 commit comments

Comments
 (0)