Skip to content

Commit

Permalink
feat(keycloak-operator): disable operator templates generation (#1272)
Browse files Browse the repository at this point in the history
Introduce `operator.enabled` value.

---------

Co-authored-by: Gwydion Martin <[email protected]>
  • Loading branch information
gwydionmv and Gwydion Martin authored Jun 13, 2024
1 parent ca4e34f commit 9bc692d
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 4 additions & 20 deletions charts/keycloak-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: keycloak-operator
description: Deploy Keycloak Operator and Keycloak
type: application
version: 1.1.0
version: 1.2.0
appVersion: "24.0.4"
icon: https://www.keycloak.org/resources/images/logo-stacked.svg
home: https://www.keycloak.org
Expand All @@ -16,23 +16,7 @@ maintainers:
annotations:
artifacthub.io/changes: |
- kind: changed
description: "Bump Keycloak 23.0.3 to 24.0.4"
description: "New feature: disable Operator templates generation"
links:
- name: "Release 24.0.4"
url: https://www.keycloak.org/2024/05/keycloak-2404-released.html
- name: "Release 24.0.3"
url: https://www.keycloak.org/2024/04/keycloak-2403-released.html
- name: "Release 24.0.2"
url: https://www.keycloak.org/2024/03/keycloak-2402-released.html
- name: "Release 24.0.1"
url: https://www.keycloak.org/2024/03/keycloak-2401-released.html
- name: "Release 24.0.0"
url: https://www.keycloak.org/2024/03/keycloak-2400-released.html
- name: "Release 23.0.7"
url: https://www.keycloak.org/2024/02/keycloak-2307-released.html
- name: "Release 23.0.6"
url: https://www.keycloak.org/2024/02/keycloak-2306-released.html
- name: "Release 23.0.5"
url: https://www.keycloak.org/2024/01/keycloak-2305-released.html
- name: "Release 23.0.4"
url: https://www.keycloak.org/2024/01/keycloak-2304-released.html
- name: "Issue 1270"
url: https://github.com/adfinis/helm-charts/issues/1270
2 changes: 1 addition & 1 deletion charts/keycloak-operator/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions charts/keycloak-operator/ci/default-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
operator:
enabled: true
replicaCount: 1
keycloak:
enabled: false
2 changes: 0 additions & 2 deletions charts/keycloak-operator/ci/operand-values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
operator:
replicaCount: 1
keycloak:
enabled: true
name: keycloak
Expand Down
6 changes: 4 additions & 2 deletions charts/keycloak-operator/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
1. The Operator has been deployed, view the logs by running this command:
{{- if .Values.operator.enabled }}
- The Operator has been deployed, view the logs by running this command:
kubectl --namespace {{ .Release.Namespace }} logs deployment/{{ include "keycloak-operator.operator.fullname" . }}
{{- end }}
{{- if .Values.keycloak.enabled }}
2. A Keycloak instance has been deployed, connect to it at "{{ .Values.keycloak.hostname.hostname }}"
- A Keycloak instance has been deployed, connect to it at "{{ .Values.keycloak.hostname.hostname }}"
{{- if .Values.keycloak.realmimport.enabled }}
Additionally the following realms have been imported:
{{- range .Values.keycloak.realmimport.realms }}
Expand Down
2 changes: 2 additions & 0 deletions charts/keycloak-operator/templates/operator/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.operator.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -41,3 +42,4 @@ rules:
- delete
- patch
- update
{{- end }}
2 changes: 2 additions & 0 deletions charts/keycloak-operator/templates/operator/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.operator.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -80,3 +81,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/keycloak-operator/templates/operator/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.operator.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
Expand Down Expand Up @@ -53,3 +54,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ include "keycloak-operator.operator.serviceAccountName" . }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/keycloak-operator/templates/operator/roles.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.operator.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
Expand Down Expand Up @@ -56,3 +57,4 @@ rules:
- delete
- patch
- update
{{- end }}
2 changes: 2 additions & 0 deletions charts/keycloak-operator/templates/operator/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.operator.enabled }}
{{- if .Values.operator.service.enabled }}
apiVersion: v1
kind: Service
Expand All @@ -15,3 +16,4 @@ spec:
selector:
{{- include "keycloak-operator.operator.selectorLabels" . | nindent 4 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.operator.enabled }}
{{- if .Values.operator.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
Expand All @@ -10,3 +11,4 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
20 changes: 10 additions & 10 deletions charts/keycloak-operator/tests/__snapshot__/default_test.yaml.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ should match snapshot:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: keycloak-operator
app.kubernetes.io/version: 24.0.4
helm.sh/chart: keycloak-operator-1.1.0
helm.sh/chart: keycloak-operator-1.2.0
name: keycloakcontroller-cluster-role
rules:
- apiGroups:
Expand All @@ -36,7 +36,7 @@ should match snapshot:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: keycloak-operator
app.kubernetes.io/version: 24.0.4
helm.sh/chart: keycloak-operator-1.1.0
helm.sh/chart: keycloak-operator-1.2.0
name: keycloakrealmimportcontroller-cluster-role
rules:
- apiGroups:
Expand All @@ -63,7 +63,7 @@ should match snapshot:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: keycloak-operator
app.kubernetes.io/version: 24.0.4
helm.sh/chart: keycloak-operator-1.1.0
helm.sh/chart: keycloak-operator-1.2.0
name: RELEASE-NAME-keycloak-operator-operator
spec:
replicas: 1
Expand Down Expand Up @@ -128,7 +128,7 @@ should match snapshot:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: keycloak-operator
app.kubernetes.io/version: 24.0.4
helm.sh/chart: keycloak-operator-1.1.0
helm.sh/chart: keycloak-operator-1.2.0
name: keycloak-operator-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand All @@ -147,7 +147,7 @@ should match snapshot:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: keycloak-operator
app.kubernetes.io/version: 24.0.4
helm.sh/chart: keycloak-operator-1.1.0
helm.sh/chart: keycloak-operator-1.2.0
name: keycloak-operator-view
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand All @@ -166,7 +166,7 @@ should match snapshot:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: keycloak-operator
app.kubernetes.io/version: 24.0.4
helm.sh/chart: keycloak-operator-1.1.0
helm.sh/chart: keycloak-operator-1.2.0
name: keycloakcontroller-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand All @@ -185,7 +185,7 @@ should match snapshot:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: keycloak-operator
app.kubernetes.io/version: 24.0.4
helm.sh/chart: keycloak-operator-1.1.0
helm.sh/chart: keycloak-operator-1.2.0
name: keycloakrealmimportcontroller-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand All @@ -204,7 +204,7 @@ should match snapshot:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: keycloak-operator
app.kubernetes.io/version: 24.0.4
helm.sh/chart: keycloak-operator-1.1.0
helm.sh/chart: keycloak-operator-1.2.0
name: keycloak-operator-role
rules:
- apiGroups:
Expand Down Expand Up @@ -267,7 +267,7 @@ should match snapshot:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: keycloak-operator
app.kubernetes.io/version: 24.0.4
helm.sh/chart: keycloak-operator-1.1.0
helm.sh/chart: keycloak-operator-1.2.0
name: RELEASE-NAME-keycloak-operator-operator
spec:
ports:
Expand All @@ -290,5 +290,5 @@ should match snapshot:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: keycloak-operator
app.kubernetes.io/version: 24.0.4
helm.sh/chart: keycloak-operator-1.1.0
helm.sh/chart: keycloak-operator-1.2.0
name: RELEASE-NAME-keycloak-operator
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ should match snapshot:
app.kubernetes.io/component: keycloak
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: 24.0.4
helm.sh/chart: keycloak-operator-1.1.0
helm.sh/chart: keycloak-operator-1.2.0
name: keycloak
spec:
features:
Expand Down Expand Up @@ -35,7 +35,7 @@ should match snapshot:
labels:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: 24.0.4
helm.sh/chart: keycloak-operator-1.1.0
helm.sh/chart: keycloak-operator-1.2.0
name: RELEASE-NAME-keycloak-operator-test
spec:
keycloakCRName: keycloak
Expand Down

0 comments on commit 9bc692d

Please sign in to comment.