Skip to content
Snippets Groups Projects
Commit 1f1763c4 authored by OZGCloud's avatar OZGCloud
Browse files

Merge branch 'master' into OZG-5400

parents ef82598c 98eecce5
No related branches found
No related tags found
No related merge requests found
Showing with 103 additions and 12 deletions
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>de.ozgcloud</groupId> <groupId>de.ozgcloud</groupId>
<artifactId>ozgcloud-operator-parent</artifactId> <artifactId>ozgcloud-operator-parent</artifactId>
<version>2.4.0-SNAPSHOT</version> <version>2.6.0-SNAPSHOT</version>
<relativePath>../</relativePath> <relativePath>../</relativePath>
</parent> </parent>
......
...@@ -5,3 +5,21 @@ ...@@ -5,3 +5,21 @@
app.kubernetes.io/name: {{ .Release.Name }} app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/namespace: {{ .Release.Namespace }} app.kubernetes.io/namespace: {{ .Release.Namespace }}
{{- end -}} {{- end -}}
{{- define "app.getCustomList" -}}
{{- with (.Values.env).customList -}}
{{- if kindIs "map" . -}}
{{ include "app.dictToList" . }}
{{- else if kindIs "slice" . -}}
{{ . | toYaml }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "app.dictToList" -}}
{{- $customList := list -}}
{{- range $key, $value := . -}}
{{- $customList = append $customList (dict "name" $key "value" $value) }}
{{- end -}}
{{- $customList | toYaml -}}
{{- end -}}
\ No newline at end of file
...@@ -49,8 +49,8 @@ spec: ...@@ -49,8 +49,8 @@ spec:
- name: ozgcloud-elasticsearch-operator - name: ozgcloud-elasticsearch-operator
image: "{{ required "image.repo must be set" (.Values.image).repo }}/{{ required "image.name must be set" (.Values.image).name }}:{{ required "image.tag must be set" (.Values.image).tag }}" image: "{{ required "image.repo must be set" (.Values.image).repo }}/{{ required "image.name must be set" (.Values.image).name }}:{{ required "image.tag must be set" (.Values.image).tag }}"
env: env:
{{- with (.Values.env).customList }} {{- with include "app.getCustomList" . }}
{{ toYaml . | indent 8 }} {{ . | indent 8 }}
{{- end }} {{- end }}
- name: SERVICE_BINDING_ROOT - name: SERVICE_BINDING_ROOT
value: "/bindings" value: "/bindings"
......
...@@ -30,12 +30,34 @@ set: ...@@ -30,12 +30,34 @@ set:
namespace: elastic-system namespace: elastic-system
adminSecretName: ozg-search-cluster-es-elastic-user adminSecretName: ozg-search-cluster-es-elastic-user
certificateSecretName: ozg-search-cluster-es-http-ca-internal certificateSecretName: ozg-search-cluster-es-http-ca-internal
image:
name: hase
tag: latest
imagePullSecret: imagePullSecret
tests: tests:
- it: check customList - it: check customList as list
set: set:
env.customList: env.customList:
- name: my_test_environment_name - name: my_test_environment_name
value: "A test value" value: "A test value"
- name: test_environment
value: "B test value"
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: my_test_environment_name
value: "A test value"
- contains:
path: spec.template.spec.containers[0].env
content:
name: test_environment
value: "B test value"
- it: check customList as dict
set:
env.customList:
my_test_environment_name: "A test value"
test_environment: "B test value"
image: image:
name: hase name: hase
tag: latest tag: latest
...@@ -46,4 +68,8 @@ tests: ...@@ -46,4 +68,8 @@ tests:
content: content:
name: my_test_environment_name name: my_test_environment_name
value: "A test value" value: "A test value"
- contains:
path: spec.template.spec.containers[0].env
content:
name: test_environment
value: "B test value"
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>de.ozgcloud</groupId> <groupId>de.ozgcloud</groupId>
<artifactId>ozgcloud-operator-parent</artifactId> <artifactId>ozgcloud-operator-parent</artifactId>
<version>2.4.0-SNAPSHOT</version> <version>2.6.0-SNAPSHOT</version>
<relativePath>../</relativePath> <relativePath>../</relativePath>
</parent> </parent>
......
...@@ -4,3 +4,21 @@ ...@@ -4,3 +4,21 @@
app.kubernetes.io/name: {{ .Release.Name }} app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/namespace: {{ .Release.Namespace }} app.kubernetes.io/namespace: {{ .Release.Namespace }}
{{- end -}} {{- end -}}
{{- define "app.getCustomList" -}}
{{- with (.Values.env).customList -}}
{{- if kindIs "map" . -}}
{{ include "app.dictToList" . }}
{{- else if kindIs "slice" . -}}
{{ . | toYaml }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "app.dictToList" -}}
{{- $customList := list -}}
{{- range $key, $value := . -}}
{{- $customList = append $customList (dict "name" $key "value" $value) }}
{{- end -}}
{{- $customList | toYaml -}}
{{- end -}}
\ No newline at end of file
...@@ -49,8 +49,8 @@ spec: ...@@ -49,8 +49,8 @@ spec:
- name: ozgcloud-keycloak-operator - name: ozgcloud-keycloak-operator
image: "{{ required "image.repo must be set" (.Values.image).repo }}/{{ required "image.name must be set" (.Values.image).name }}:{{ required "image.tag must be set" (.Values.image).tag }}" image: "{{ required "image.repo must be set" (.Values.image).repo }}/{{ required "image.name must be set" (.Values.image).name }}:{{ required "image.tag must be set" (.Values.image).tag }}"
env: env:
{{- with (.Values.env).customList }} {{- with include "app.getCustomList" . }}
{{ toYaml . | indent 8 }} {{ . | indent 8 }}
{{- end }} {{- end }}
imagePullPolicy: Always imagePullPolicy: Always
# readinessProbe: # readinessProbe:
......
...@@ -51,7 +51,9 @@ class OzgCloudKeycloakRealmSpec { ...@@ -51,7 +51,9 @@ class OzgCloudKeycloakRealmSpec {
private KeycloakRealmSMTPServer smtpServer; private KeycloakRealmSMTPServer smtpServer;
@Getter @Getter
@Setter
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
static class KeycloakRealmSMTPServer { static class KeycloakRealmSMTPServer {
...@@ -70,12 +72,13 @@ class OzgCloudKeycloakRealmSpec { ...@@ -70,12 +72,13 @@ class OzgCloudKeycloakRealmSpec {
private String fromDisplayName; private String fromDisplayName;
} }
@Builder.Default @Builder.Default
private List<RealmRole> realmRoles = new ArrayList<>(); private List<RealmRole> realmRoles = new ArrayList<>();
@Getter @Getter
@Setter
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
static class RealmRole { static class RealmRole {
......
...@@ -31,16 +31,42 @@ set: ...@@ -31,16 +31,42 @@ set:
name: hase name: hase
tag: latest tag: latest
tests: tests:
- it: check customList - it: check customList as list
template: deployment.yaml
set: set:
env.customList: env.customList:
- name: my_test_environment_name - name: my_test_environment_name
value: "A test value" value: "A test value"
- name: test_environment
value: "B test value"
asserts: asserts:
- contains: - contains:
path: spec.template.spec.containers[0].env path: spec.template.spec.containers[0].env
content: content:
name: my_test_environment_name name: my_test_environment_name
value: "A test value" value: "A test value"
- contains:
path: spec.template.spec.containers[0].env
content:
name: test_environment
value: "B test value"
- it: check customList as dict
set:
env.customList:
my_test_environment_name: "A test value"
test_environment: "B test value"
image:
name: hase
tag: latest
imagePullSecret: imagePullSecret
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: my_test_environment_name
value: "A test value"
- contains:
path: spec.template.spec.containers[0].env
content:
name: test_environment
value: "B test value"
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<groupId>de.ozgcloud</groupId> <groupId>de.ozgcloud</groupId>
<artifactId>ozgcloud-operator-parent</artifactId> <artifactId>ozgcloud-operator-parent</artifactId>
<version>2.4.0-SNAPSHOT</version> <version>2.6.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>OzgCloud Operator Parent</name> <name>OzgCloud Operator Parent</name>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment