diff --git a/VERSION b/VERSION index 869c1ce9..5f06dfcd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.3.45 \ No newline at end of file +v0.3.46 \ No newline at end of file diff --git a/chart/Chart.yaml b/chart/Chart.yaml index f0b22a7b..8c6fdd0a 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 description: A Helm chart for kraan controller name: kraan-controller type: application -appVersion: v0.3.45 -version: v0.3.45 +appVersion: v0.3.46 +version: v0.3.46 diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index 0e3ad1ce..79e223eb 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -30,3 +30,12 @@ Create chart name and version as used by the chart label. {{- define "kraan-controller.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{- define "kraan-controller.gotk.adminClusterRoleBinding.name" -}} +{{ $crbName := .Values.gotk.rbac.adminClusterRoleBinding.name }} +{{- if eq $crbName "cluster-reconciler" -}} +{{ $crbName }}-{{ .Release.Namespace }} +{{- else -}} +{{ $crbName }} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/chart/templates/gotk/rbac.yaml b/chart/templates/gotk/rbac.yaml index 6872befb..b5ae01de 100644 --- a/chart/templates/gotk/rbac.yaml +++ b/chart/templates/gotk/rbac.yaml @@ -149,7 +149,7 @@ metadata: labels: app.kubernetes.io/instance: "{{ .Release.Namespace }}" app.kubernetes.io/version: latest - name: cluster-reconciler-{{.Release.Namespace}} + name: {{ template "kraan-controller.gotk.adminClusterRoleBinding.name" . }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/chart/templates/kraan/rbac.yaml b/chart/templates/kraan/rbac.yaml index 192fed5e..ef96897c 100644 --- a/chart/templates/kraan/rbac.yaml +++ b/chart/templates/kraan/rbac.yaml @@ -152,7 +152,7 @@ subjects: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: kraan-deployer + name: {{ .Values.kraan.rbac.adminClusterRoleBinding.name }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/chart/values.yaml b/chart/values.yaml index 9a5f447e..9de8202d 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -22,6 +22,8 @@ kraan: # specify rules to create a ClusterRole # https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#policyrule-v1-rbac-authorization-k8s-io rules: [] + adminClusterRoleBinding: + name: "kraan-deployer" netpolicy: enabled: true kraanController: @@ -93,6 +95,8 @@ gotk: # specify rules to create a ClusterRole # https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#policyrule-v1-rbac-authorization-k8s-io rules: [] + adminClusterRoleBinding: + name: "cluster-reconciler" netpolicy: enabled: true diff --git a/go.mod b/go.mod index 66e4f165..507a11bf 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.20.5 go.uber.org/zap v1.27.0 - golang.org/x/mod v0.22.0 + golang.org/x/mod v0.23.0 k8s.io/api v0.31.1 k8s.io/apiextensions-apiserver v0.31.1 k8s.io/apimachinery v0.31.1 diff --git a/go.sum b/go.sum index 4263d2b6..a1219567 100644 --- a/go.sum +++ b/go.sum @@ -229,8 +229,8 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= -golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= +golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=