Skip to content

Commit 013a68a

Browse files
day0herombaldessaristocky37
authored
Common (#100)
* Add some comments to make if/else and loops clearer Let's improve readability by adding some comments to point out which flow constructs are being ended. * Add some more comments in applications.yaml * Add a default for options applicationRetryLimit * Split out values files to a helper for the acm chart Just like we did for the clustergroup chart, let's split the values file list into a dedicated helper. This time since there are no global variables we include it with the current context and not with the '$' context. Tested with MCG: hub and spoke. Correctly observed all the applications running on the spoke. * Fix up tests They changed because we made the list indentation more correct (two extra spaces to the left) * Fix sa/namespace mixup in vault_spokes_init * Update local patch Also set seccompProfile to null to make things work on OCP 4.10 * Update ESO to 0.8.5 * Tweak ESO UBI images Tested the ESO upgrade on MCG on both 4.10 and 4.13 * Removed previous version of common to convert to subtree from https://github.com/hybrid-cloud-patterns/common.git main * make test --------- Co-authored-by: Michele Baldessari <michele@acksyn.org> Co-authored-by: Tom Stockwell <2060486+stocky37@users.noreply.github.com>
1 parent 41059b0 commit 013a68a

26 files changed

Lines changed: 497 additions & 532 deletions

common/acm/templates/_helpers.tpl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{/*
2+
Default always defined valueFiles to be included when pushing the cluster wide argo application via acm
3+
*/}}
4+
{{- define "acm.app.policies.valuefiles" -}}
5+
- "/values-global.yaml"
6+
- "/values-{{ .name }}.yaml"
7+
- '/values-{{ `{{ (lookup "config.openshift.io/v1" "Infrastructure" "" "cluster").spec.platformSpec.type }}` }}.yaml'
8+
- '/values-{{ `{{ (lookup "config.openshift.io/v1" "Infrastructure" "" "cluster").spec.platformSpec.type }}` }}-{{ `{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}` }}.yaml'
9+
- '/values-{{ `{{ (lookup "config.openshift.io/v1" "Infrastructure" "" "cluster").spec.platformSpec.type }}` }}-{{ .name }}.yaml'
10+
# We cannot use $.Values.global.clusterVersion because that gets resolved to the
11+
# hub's cluster version, whereas we want to include the spoke cluster version
12+
- '/values-{{ `{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}` }}-{{ .name }}.yaml'
13+
{{- end }} {{- /*acm.app.policies.valuefiles */}}

common/acm/templates/policies/application-policies.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,7 @@ spec:
4343
helm:
4444
ignoreMissingValueFiles: true
4545
valueFiles:
46-
- "/values-global.yaml"
47-
- "/values-{{ .name }}.yaml"
48-
- '/values-{{ `{{ (lookup "config.openshift.io/v1" "Infrastructure" "" "cluster").spec.platformSpec.type }}` }}.yaml'
49-
- '/values-{{ `{{ (lookup "config.openshift.io/v1" "Infrastructure" "" "cluster").spec.platformSpec.type }}` }}-{{ `{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}` }}.yaml'
50-
- '/values-{{ `{{ (lookup "config.openshift.io/v1" "Infrastructure" "" "cluster").spec.platformSpec.type }}` }}-{{ .name }}.yaml'
51-
# We cannot use $.Values.global.clusterVersion because that gets resolved to the
52-
# hub's cluster version, whereas we want to include the spoke cluster version
53-
- '/values-{{ `{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}` }}-{{ .name }}.yaml'
46+
{{- include "acm.app.policies.valuefiles" . | nindent 24 }}
5447
{{- range $valueFile := .extraValueFiles }}
5548
- {{ $valueFile | quote }}
5649
{{- end }}

common/acm/values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ global:
66
pattern: none
77
repoURL: none
88
targetRevision: main
9-
9+
options:
10+
applicationRetryLimit: 20
1011

1112
clusterGroup:
1213
subscriptions:

common/ansible/roles/vault_utils/tasks/vault_spokes_init.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@
182182
pod: "{{ vault_pod }}"
183183
command: >
184184
vault write auth/"{{ item.value['vault_path'] }}"/role/"{{ item.value['vault_path'] }}"-role
185-
bound_service_account_names="{{ external_secrets_ns }}"
186-
bound_service_account_namespaces="{{ external_secrets_sa }}"
185+
bound_service_account_names="{{ external_secrets_sa }}"
186+
bound_service_account_namespaces="{{ external_secrets_ns }}"
187187
policies="default,{{ vault_global_policy }}-secret,{{ item.value['vault_path'] }}-secret" ttl="{{ vault_spoke_ttl }}"
188188
loop: "{{ clusters_info | dict2items }}"
189189
when:

common/clustergroup/templates/plumbing/applications.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ spec:
134134
chart: {{ .chart }}
135135
{{- else }}
136136
path: {{ .path }}
137-
{{- end }}
137+
{{- end }}{{- /* if .chart */}}
138138
{{- if .plugin }}
139139
plugin: {{ .plugin | toPrettyJson }}
140140
{{- else if not .kustomize }}
@@ -178,18 +178,18 @@ spec:
178178
{{- range .overrides }}
179179
- name: {{ .name }}
180180
value: {{ .value | quote }}
181-
{{- if .forceString }}
181+
{{- if .forceString }}
182182
forceString: true
183-
{{- end }}
184-
{{- end }}
183+
{{- end }}
184+
{{- end }}{{- /* range .overrides */}}
185185
{{- if .fileParameters }}
186186
fileParameters:
187187
{{- range .fileParameters }}
188188
- name: {{ .name }}
189189
path: {{ .path }}
190-
{{- end }}
191-
{{- end }}
192-
{{- end }}
190+
{{- end }}{{- /* range .fileParameters */}}
191+
{{- end }}{{- /* if .fileParameters */}}
192+
{{- end }}{{- /* if .plugin */}}
193193
{{- if .ignoreDifferences }}
194194
ignoreDifferences: {{ .ignoreDifferences | toPrettyJson }}
195195
{{- end }}
@@ -200,8 +200,8 @@ spec:
200200
automated: {}
201201
retry:
202202
limit: {{ default 20 $.Values.global.applicationRetryLimit }}
203-
{{- end }}
203+
{{- end }}{{- /* .syncPolicy */}}
204204
---
205-
{{- end }}
206-
{{- end }}
207-
{{- end }}
205+
{{- end }}{{- /* if or (.generators) (.generatorFile) (.useGeneratorValues) (.destinationServer) (.destinationNamespace) */}}
206+
{{- end }}{{- /* range .Values.clusterGroup.applications */}}
207+
{{- end }}{{- /* if not (eq .Values.enabled "core") */}}

common/golang-external-secrets/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ name: golang-external-secrets
66
version: 0.0.1
77
dependencies:
88
- name: external-secrets
9-
version: "0.8.3"
9+
version: "0.8.5"
1010
repository: "https://charts.external-secrets.io"
1111
#"https://external-secrets.github.io/kubernetes-external-secrets"
-76.7 KB
Binary file not shown.
76.8 KB
Binary file not shown.
Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,48 @@
1-
diff --color -urN external-secrets.orig/values.yaml external-secrets/values.yaml
2-
--- external-secrets.orig/values.yaml 2023-05-22 12:42:54.000000000 +0200
3-
+++ external-secrets/values.yaml 2023-05-22 16:20:02.748621794 +0200
4-
@@ -117,7 +117,7 @@
1+
diff -up external-secrets/values.yaml.orig external-secrets/values.yaml
2+
--- external-secrets/values.yaml.orig 2023-07-31 15:12:18.815909938 +0200
3+
+++ external-secrets/values.yaml 2023-07-31 15:32:59.905360226 +0200
4+
@@ -117,9 +117,11 @@ securityContext:
55
- ALL
66
readOnlyRootFilesystem: true
77
runAsNonRoot: true
88
- runAsUser: 1000
9+
- seccompProfile:
10+
- type: RuntimeDefault
911
+ # runAsUser: 1000
10-
seccompProfile:
11-
type: RuntimeDefault
12+
+ # Uncomment this once 4.10 is out of scope
13+
+ # seccompProfile:
14+
+ # type: RuntimeDefault
15+
+ seccompProfile: null
1216

13-
@@ -331,7 +331,7 @@
17+
resources: {}
18+
# requests:
19+
@@ -331,9 +333,11 @@ webhook:
1420
- ALL
1521
readOnlyRootFilesystem: true
1622
runAsNonRoot: true
1723
- runAsUser: 1000
24+
- seccompProfile:
25+
- type: RuntimeDefault
1826
+ # runAsUser: 1000
19-
seccompProfile:
20-
type: RuntimeDefault
27+
+ seccompProfile: null
28+
+ # Uncomment this once 4.10 is out of scope
29+
+ # seccompProfile:
30+
+ # type: RuntimeDefault
2131

22-
@@ -453,7 +453,7 @@
32+
resources: {}
33+
# requests:
34+
@@ -453,9 +457,11 @@ certController:
2335
- ALL
2436
readOnlyRootFilesystem: true
2537
runAsNonRoot: true
2638
- runAsUser: 1000
39+
- seccompProfile:
40+
- type: RuntimeDefault
2741
+ # runAsUser: 1000
28-
seccompProfile:
29-
type: RuntimeDefault
42+
+ seccompProfile: null
43+
+ # Uncomment this once 4.10 is out of scope
44+
+ # seccompProfile:
45+
+ # type: RuntimeDefault
3046

47+
resources: {}
48+
# requests:

common/golang-external-secrets/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ clusterGroup:
1111

1212
external-secrets:
1313
image:
14-
tag: v0.8.3-ubi
14+
tag: v0.8.5-ubi
1515
webhook:
1616
image:
17-
tag: v0.8.3-ubi
17+
tag: v0.8.5-ubi
1818
certController:
1919
image:
20-
tag: v0.8.3-ubi
20+
tag: v0.8.5-ubi

0 commit comments

Comments
 (0)