Skip to content

Commit 6c81b79

Browse files
authored
[patch] Ensure external label added to routes prior to configtool oidc registration attempt. Fix .Values.ingress checks. (#252)
1 parent d46e657 commit 6c81b79

File tree

5 files changed

+25
-22
lines changed

5 files changed

+25
-22
lines changed

cluster-applications/030-ibm-cis-cert-manager/templates/00-8-ibm-cis-webhook_cis-ingress-controller.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
{{- if and (eq .Values.dns_provider "cis") (.Values.ingress) }}
1+
# .Values.ingress is properly passed into the cis-cert-manager app as a boolean
2+
# (see https://github.com/ibm-mas/gitops/blob/d46e6577fc2081e0a5624dddf575cead5310d794/root-applications/ibm-mas-cluster-root/templates/030-ibm-cis-cert-manager.yaml#L51)
3+
# Nevertheless, for consistency with checks against .Values.ingress in other charts, we will also accept the string "true" here.
4+
{{- if and (eq .Values.dns_provider "cis") (eq (toString .Values.ingress) "true") }}
25
---
36
apiVersion: operator.openshift.io/v1
47
kind: IngressController

instance-applications/130-ibm-mas-suite/templates/05-postsync-add-label_Job.yaml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
{{- if .Values.ingress }}
1+
# .Values.ingress is passed into the suite as a string (even though the original value is a boolean)
2+
# (see https://github.com/ibm-mas/gitops/blob/d46e6577fc2081e0a5624dddf575cead5310d794/root-applications/ibm-mas-instance-root/templates/130-ibm-mas-suite-app.yaml#L60)
3+
# This meant the check was passing even when ingress was false (.Values.ingress is considered true when it is the string "false")
4+
# Rather than change the suite app (and force it to resync in all existing envs), we'll instead fix the check here to look for either boolean true OR the string "true".
5+
{{- if (eq (toString .Values.ingress) "true") }}
26

37
{{ $job_label := "mas-route-patch" }}
48
---
@@ -11,8 +15,6 @@ metadata:
1115
namespace: mas-{{ .Values.instance_id }}-core
1216
annotations:
1317
argocd.argoproj.io/sync-wave: "140"
14-
argocd.argoproj.io/hook: PostSync
15-
argocd.argoproj.io/hook-delete-policy: HookSucceeded,BeforeHookCreation
1618
{{- if .Values.custom_labels }}
1719
labels:
1820
{{ .Values.custom_labels | toYaml | indent 4 }}
@@ -35,8 +37,6 @@ metadata:
3537
namespace: mas-{{ .Values.instance_id }}-core
3638
annotations:
3739
argocd.argoproj.io/sync-wave: "140"
38-
argocd.argoproj.io/hook: PostSync
39-
argocd.argoproj.io/hook-delete-policy: HookSucceeded,BeforeHookCreation
4040
{{- if .Values.custom_labels }}
4141
labels:
4242
{{ .Values.custom_labels | toYaml | indent 4 }}
@@ -50,8 +50,6 @@ metadata:
5050
name: mas-route-prereq-role-{{ .Values.instance_id }}
5151
annotations:
5252
argocd.argoproj.io/sync-wave: "140"
53-
argocd.argoproj.io/hook: PostSync
54-
argocd.argoproj.io/hook-delete-policy: HookSucceeded,BeforeHookCreation
5553
{{- if .Values.custom_labels }}
5654
labels:
5755
{{ .Values.custom_labels | toYaml | indent 4 }}
@@ -81,8 +79,6 @@ metadata:
8179
name: mas-route-prereq-rb-{{ .Values.instance_id }}
8280
annotations:
8381
argocd.argoproj.io/sync-wave: "141"
84-
argocd.argoproj.io/hook: PostSync
85-
argocd.argoproj.io/hook-delete-policy: HookSucceeded,BeforeHookCreation
8682
{{- if .Values.custom_labels }}
8783
labels:
8884
{{ .Values.custom_labels | toYaml | indent 4 }}
@@ -100,12 +96,10 @@ roleRef:
10096
apiVersion: batch/v1
10197
kind: Job
10298
metadata:
103-
name: mas-route-patch-v1-{{ omit .Values "junitreporter" | toYaml | adler32sum }}
99+
name: mas-route-patch-v2-{{ omit .Values "junitreporter" | toYaml | adler32sum }}
104100
namespace: mas-{{ .Values.instance_id }}-core
105101
annotations:
106102
argocd.argoproj.io/sync-wave: "142"
107-
argocd.argoproj.io/hook: PostSync
108-
argocd.argoproj.io/hook-delete-policy: HookSucceeded,BeforeHookCreation
109103
{{- if .Values.custom_labels }}
110104
labels:
111105
{{ .Values.custom_labels | toYaml | indent 4 }}

instance-applications/130-ibm-mas-suite/templates/05-postsync-configtool-oidc.yaml renamed to instance-applications/130-ibm-mas-suite/templates/06-postsync-configtool-oidc.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ metadata:
1515
name: {{ $np_name }}
1616
namespace: {{ $ns }}
1717
annotations:
18-
argocd.argoproj.io/sync-wave: "140"
18+
argocd.argoproj.io/sync-wave: "143"
1919
{{- if .Values.custom_labels }}
2020
labels:
2121
{{ .Values.custom_labels | toYaml | indent 4 }}
@@ -37,7 +37,7 @@ metadata:
3737
name: {{ $sa_name }}
3838
namespace: {{ $ns }}
3939
annotations:
40-
argocd.argoproj.io/sync-wave: "140"
40+
argocd.argoproj.io/sync-wave: "143"
4141
{{- if .Values.custom_labels }}
4242
labels:
4343
{{ .Values.custom_labels | toYaml | indent 4 }}
@@ -50,7 +50,7 @@ metadata:
5050
name: {{ $role_name }}
5151
namespace: {{ $ns }}
5252
annotations:
53-
argocd.argoproj.io/sync-wave: "140"
53+
argocd.argoproj.io/sync-wave: "143"
5454
{{- if .Values.custom_labels }}
5555
labels:
5656
{{ .Values.custom_labels | toYaml | indent 4 }}
@@ -64,7 +64,7 @@ metadata:
6464
name: {{ $rb_name }}
6565
namespace: {{ $ns }}
6666
annotations:
67-
argocd.argoproj.io/sync-wave: "141"
67+
argocd.argoproj.io/sync-wave: "144"
6868
{{- if .Values.custom_labels }}
6969
labels:
7070
{{ .Values.custom_labels | toYaml | indent 4 }}
@@ -83,10 +83,10 @@ roleRef:
8383
apiVersion: batch/v1
8484
kind: Job
8585
metadata:
86-
name: {{ $job_label }}-v1-{{ omit .Values "junitreporter" | toYaml | adler32sum }}
86+
name: {{ $job_label }}-v2-{{ omit .Values "junitreporter" | toYaml | adler32sum }}
8787
namespace: {{ $ns }}
8888
annotations:
89-
argocd.argoproj.io/sync-wave: "142"
89+
argocd.argoproj.io/sync-wave: "145"
9090
{{- if .Values.custom_labels }}
9191
labels:
9292
{{ .Values.custom_labels | toYaml | indent 4 }}

instance-applications/220-ibm-mas-workspace/templates/05-postsync-add-label_Job.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
{{- if .Values.ingress }}
2-
1+
# .Values.ingress is passed into the workspace as a string (even though the original value is a boolean)
2+
# (see https://github.com/ibm-mas/gitops/blob/d46e6577fc2081e0a5624dddf575cead5310d794/root-applications/ibm-mas-instance-root/templates/200-ibm-mas-workspaces.yaml#L44)
3+
# This meant the check was passing even when ingress was false (.Values.ingress is considered true when it is the string "false")
4+
# Rather than change the workspace app (and force it to resync in all existing envs), we'll instead fix the check here to look for either boolean true OR the string "true".
5+
{{- if (eq (toString .Values.ingress) "true") }}
36
{{ $job_label := "mas-ws-route-patch" }}
47
---
58
# Permit outbound communication by the Job pods

instance-applications/510-550-ibm-mas-suite-app-config/templates/04-postsync-add-label_Job.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
{{- if .Values.ingress }}
1+
# .Values.ingress is properly passed into the suite-app-config app as a boolean
2+
# (see https://github.com/ibm-mas/gitops/blob/d46e6577fc2081e0a5624dddf575cead5310d794/root-applications/ibm-mas-instance-root/templates/510-550-ibm-mas-masapp-configs.yaml#L67)
3+
# Nevertheless, for consistency with checks against .Values.ingress in other charts, we will also accept the string "true" here.
4+
{{- if (eq (toString .Values.ingress) "true") }}
25

36
{{ $ns := .Values.mas_app_namespace }}
47
{{ $job_label := "mas-app-route-patch" }}

0 commit comments

Comments
 (0)