diff --git a/Chart.yaml b/Chart.yaml index 2d6ce2a..f32d762 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -5,7 +5,7 @@ home: https://github.com/validatedpatterns/aap-config-chart.git keywords: - pattern name: aap-config -version: 0.2.8 +version: 0.2.9 dependencies: - name: vp-rbac version: '0.1.*' diff --git a/README.md b/README.md index 858a8c2..55311b9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # aap-config -![Version: 0.2.8](https://img.shields.io/badge/Version-0.2.8-informational?style=flat-square) +![Version: 0.2.9](https://img.shields.io/badge/Version-0.2.9-informational?style=flat-square) A Helm chart to build and deploy secrets using external-secrets for ansible-edge-gitops @@ -65,6 +65,9 @@ pod does not burn `backoffLimit` and a replacement pod resumes the work, and `terminationGracePeriodSeconds` is set to 60 so a node drain is never blocked waiting for a job pod. +* v0.2.9: Add `status: True` because Job in OCP <= 4.20 requires it. It became +optional subsequently but is still compatible with OCP 4.22+ and 5.0+. + ### Git authentication secret (`agof.gitAuthSecret`) When `agof_repo` or the config-as-code repo (`agof.cac_repo` / `agof.iac_repo`) is diff --git a/README.md.gotmpl b/README.md.gotmpl index 6ce041c..acd73dd 100644 --- a/README.md.gotmpl +++ b/README.md.gotmpl @@ -66,6 +66,9 @@ pod does not burn `backoffLimit` and a replacement pod resumes the work, and `terminationGracePeriodSeconds` is set to 60 so a node drain is never blocked waiting for a job pod. +* v0.2.9: Add `status: True` because Job in OCP <= 4.20 requires it. It became +optional subsequently but is still compatible with OCP 4.22+ and 5.0+. + ### Git authentication secret (`agof.gitAuthSecret`) When `agof_repo` or the config-as-code repo (`agof.cac_repo` / `agof.iac_repo`) is diff --git a/templates/agof-config-bootstrap-job.yaml b/templates/agof-config-bootstrap-job.yaml index ac392b9..12df8bd 100644 --- a/templates/agof-config-bootstrap-job.yaml +++ b/templates/agof-config-bootstrap-job.yaml @@ -21,6 +21,7 @@ spec: - action: Ignore onPodConditions: - type: DisruptionTarget + status: "True" parallelism: 1 completions: 1 backoffLimit: 99 diff --git a/templates/agof-config-cronjob.yaml b/templates/agof-config-cronjob.yaml index 04e7522..5e7a284 100644 --- a/templates/agof-config-cronjob.yaml +++ b/templates/agof-config-cronjob.yaml @@ -25,6 +25,7 @@ spec: - action: Ignore onPodConditions: - type: DisruptionTarget + status: "True" template: spec: activeDeadlineSeconds: {{ $.Values.configJob.activeDeadlineSeconds }} diff --git a/templates/external-secrets-validation-job.yaml b/templates/external-secrets-validation-job.yaml index 5fcd691..5a9829a 100644 --- a/templates/external-secrets-validation-job.yaml +++ b/templates/external-secrets-validation-job.yaml @@ -22,6 +22,7 @@ spec: - action: Ignore onPodConditions: - type: DisruptionTarget + status: "True" parallelism: 1 completions: 1 backoffLimit: {{ $.Values.validationJob.backoffLimit }} diff --git a/tests/drain-cancelable_test.yaml b/tests/drain-cancelable_test.yaml index 4e9904c..f503733 100644 --- a/tests/drain-cancelable_test.yaml +++ b/tests/drain-cancelable_test.yaml @@ -10,24 +10,33 @@ tests: template: templates/external-secrets-validation-job.yaml asserts: # Drain evictions are ignored, not counted as failures - - equal: + - &pod-failure-action + equal: path: spec.podFailurePolicy.rules[0].action value: Ignore - equal: path: spec.podFailurePolicy.rules[0].onExitCodes.containerName value: secrets-validator - - equal: + - &exit-codes-operator + equal: path: spec.podFailurePolicy.rules[0].onExitCodes.operator value: In - - equal: + - &exit-codes-values + equal: path: spec.podFailurePolicy.rules[0].onExitCodes.values value: [143] - - equal: + - &disruption-action + equal: path: spec.podFailurePolicy.rules[1].action value: Ignore - - equal: + - &disruption-type + equal: path: spec.podFailurePolicy.rules[1].onPodConditions[0].type value: DisruptionTarget + - &disruption-status + equal: + path: spec.podFailurePolicy.rules[1].onPodConditions[0].status + value: "True" # Short grace period so a drain is never blocked - equal: path: spec.template.spec.terminationGracePeriodSeconds @@ -40,21 +49,12 @@ tests: - it: Bootstrap job ignores drain evictions and exit 143 template: templates/agof-config-bootstrap-job.yaml asserts: - - equal: - path: spec.podFailurePolicy.rules[0].action - value: Ignore - - equal: - path: spec.podFailurePolicy.rules[0].onExitCodes.operator - value: In - - equal: - path: spec.podFailurePolicy.rules[0].onExitCodes.values - value: [143] - - equal: - path: spec.podFailurePolicy.rules[1].action - value: Ignore - - equal: - path: spec.podFailurePolicy.rules[1].onPodConditions[0].type - value: DisruptionTarget + - *pod-failure-action + - *exit-codes-operator + - *exit-codes-values + - *disruption-action + - *disruption-type + - *disruption-status - equal: path: spec.template.spec.terminationGracePeriodSeconds value: 60 @@ -77,6 +77,9 @@ tests: - equal: path: spec.jobTemplate.spec.podFailurePolicy.rules[1].onPodConditions[0].type value: DisruptionTarget + - equal: + path: spec.jobTemplate.spec.podFailurePolicy.rules[1].onPodConditions[0].status + value: "True" - equal: path: spec.jobTemplate.spec.template.spec.terminationGracePeriodSeconds value: 60 diff --git a/tests/helm-values-cm_test.yaml b/tests/helm-values-cm_test.yaml index 8cf5d2e..2404853 100644 --- a/tests/helm-values-cm_test.yaml +++ b/tests/helm-values-cm_test.yaml @@ -33,7 +33,7 @@ tests: cac_revision: "" iac_repo: https://github.com/example/iac.git iac_revision: main - asserts: + asserts: &legacy-resolution-asserts - matchRegex: path: data["values.yaml"] pattern: 'cac_repo: https://github.com/example/iac.git' @@ -52,16 +52,4 @@ tests: agof: iac_repo: https://github.com/example/iac.git iac_revision: main - asserts: - - matchRegex: - path: data["values.yaml"] - pattern: 'cac_repo: https://github.com/example/iac.git' - - matchRegex: - path: data["values.yaml"] - pattern: 'cac_revision: main' - - matchRegex: - path: data["values.yaml"] - pattern: 'iac_repo: https://github.com/example/iac.git' - - matchRegex: - path: data["values.yaml"] - pattern: 'iac_revision: main' + asserts: *legacy-resolution-asserts