Skip to content

Commit

Permalink
Merge pull request #445 from percona/EVEREST-1746.2
Browse files Browse the repository at this point in the history
EVEREST-1746 | Update RBAC for pre-upgrade hook
  • Loading branch information
mayankshah1607 authored Dec 13, 2024
2 parents b299aa7 + d346388 commit ac14cc7
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 8 deletions.
6 changes: 3 additions & 3 deletions charts/everest/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies:
- name: common
repository: file://charts/common
version: 0.0.10
version: 0.0.11
- name: everest-db-namespace
repository: file://charts/everest-db-namespace
version: 0.0.0
Expand All @@ -11,5 +11,5 @@ dependencies:
- name: victoria-metrics-operator
repository: https://victoriametrics.github.io/helm-charts
version: 0.37.0
digest: sha256:7ff4b6b7298b24aa96d2bf73cb3ce3c891997f016815e18acaaf326c603621e1
generated: "2024-12-12T18:45:12.381768+05:30"
digest: sha256:54860d2efc9709c4b9808b3f3929e5dc1e744681c9c81c40f698d2d06cf184ff
generated: "2024-12-12T20:56:54.266112+05:30"
2 changes: 1 addition & 1 deletion charts/everest/charts/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: common
description: A library chart for Everest containing common resources.
type: library
version: 0.0.10
version: 0.0.11
appVersion: "0.0.3"
maintainers:
- name: mayankshah1607
Expand Down
2 changes: 1 addition & 1 deletion charts/everest/charts/common/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# common

![Version: 0.0.10](https://img.shields.io/badge/Version-0.0.10-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: 0.0.3](https://img.shields.io/badge/AppVersion-0.0.3-informational?style=flat-square)
![Version: 0.0.11](https://img.shields.io/badge/Version-0.0.11-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: 0.0.3](https://img.shields.io/badge/AppVersion-0.0.3-informational?style=flat-square)

A library chart for Everest containing common resources.

Expand Down
39 changes: 39 additions & 0 deletions charts/everest/charts/common/templates/_upgrade_checks.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,45 @@ subjects:
name: {{ $hookName }}
namespace: {{ .namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ $hookName }}
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
rules:
- apiGroups:
- ""
resources:
- namespaces
verbs:
- list
- apiGroups:
- operators.coreos.com
resources:
- subscriptions
- clusterserviceversions
verbs:
- get
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ $hookName }}
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ $hookName }}
subjects:
- kind: ServiceAccount
name: {{ $hookName }}
namespace: {{ .namespace }}
---
apiVersion: batch/v1
kind: Job
metadata:
Expand Down
6 changes: 3 additions & 3 deletions charts/everest/charts/everest-db-namespace/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: file://../common
version: 0.0.10
digest: sha256:d4cac358be2d69d442c3ab82ce0945f65ea1101909b3ec3a22202cc19dbcdae9
generated: "2024-12-12T18:45:16.470721+05:30"
version: 0.0.11
digest: sha256:76207a0fd5b735778bb6df03fb4859334fff0381b71fc719cdaa89d1608049bb
generated: "2024-12-12T20:56:58.278472+05:30"

0 comments on commit ac14cc7

Please sign in to comment.