Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Commit 4c54192

Browse files
prydieowainlewis
authored andcommitted
Fix CRD and RBAC issues when installing 0.1.x via helm (#142)
* Use old v1 CRDs when installing 0.1.x
1 parent fa0749f commit 4c54192

File tree

2 files changed

+73
-3
lines changed

2 files changed

+73
-3
lines changed

mysql-operator/templates/01-resources.yaml

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,70 @@
1-
{{ if .Values.operator.register_crd }}
1+
{{- if .Values.operator.register_crd -}}
2+
{{- if hasPrefix "0.1" .Values.image.tag -}}
3+
---
4+
apiVersion: apiextensions.k8s.io/v1beta1
5+
kind: CustomResourceDefinition
6+
metadata:
7+
name: mysqlclusters.mysql.oracle.com
8+
labels:
9+
release: {{ .Release.Name }}
10+
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
11+
spec:
12+
group: mysql.oracle.com
13+
version: v1
14+
scope: Namespaced
15+
names:
16+
kind: MySQLCluster
17+
singular: mysqlcluster
18+
plural: mysqlclusters
19+
---
20+
apiVersion: apiextensions.k8s.io/v1beta1
21+
kind: CustomResourceDefinition
22+
metadata:
23+
name: mysqlbackups.mysql.oracle.com
24+
labels:
25+
release: {{ .Release.Name }}
26+
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
27+
spec:
28+
group: mysql.oracle.com
29+
version: v1
30+
scope: Namespaced
31+
names:
32+
kind: MySQLBackup
33+
singular: mysqlbackup
34+
plural: mysqlbackups
35+
---
36+
apiVersion: apiextensions.k8s.io/v1beta1
37+
kind: CustomResourceDefinition
38+
metadata:
39+
name: mysqlrestores.mysql.oracle.com
40+
labels:
41+
release: {{ .Release.Name }}
42+
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
43+
spec:
44+
group: mysql.oracle.com
45+
version: v1
46+
scope: Namespaced
47+
names:
48+
kind: MySQLRestore
49+
singular: mysqlrestore
50+
plural: mysqlrestores
51+
---
52+
apiVersion: apiextensions.k8s.io/v1beta1
53+
kind: CustomResourceDefinition
54+
metadata:
55+
name: mysqlbackupschedules.mysql.oracle.com
56+
labels:
57+
release: {{ .Release.Name }}
58+
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
59+
spec:
60+
group: mysql.oracle.com
61+
version: v1
62+
scope: Namespaced
63+
names:
64+
kind: MySQLBackupSchedule
65+
singular: mysqlbackupschedule
66+
plural: mysqlbackupschedules
67+
{{- else -}}
268
---
369
apiVersion: apiextensions.k8s.io/v1beta1
470
kind: CustomResourceDefinition
@@ -63,4 +129,5 @@ spec:
63129
kind: BackupSchedule
64130
singular: mysqlbackupschedule
65131
plural: mysqlbackupschedules
66-
{{ end }}
132+
{{- end -}}
133+
{{- end -}}

mysql-operator/templates/02-rbac.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ metadata:
1313
namespace: {{ if .Values.operator.global }}default{{ else }}{{ .Values.operator.namespace}}{{ end }}
1414

1515
---
16-
{{- if .Values.rbac.enabled }}
16+
{{- if .Values.rbac.enabled -}}
1717
apiVersion: rbac.authorization.k8s.io/v1beta1
1818
kind: {{ if .Values.operator.global }}Cluster{{ end }}Role
1919
metadata:
@@ -42,6 +42,9 @@ rules:
4242
- ""
4343
resources:
4444
- services
45+
{{- if hasPrefix "0.1" .Values.image.tag }}
46+
- configmaps
47+
{{- end }}
4548
verbs:
4649
- create
4750
- get

0 commit comments

Comments
 (0)