diff --git a/Chart.yaml b/Chart.yaml index 1defe9d..be43bec 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.4 +version: 0.3.5 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/README.md b/README.md index 804b6c2..921359f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,15 @@ # openshift-data-foundations -![Version: 0.3.4](https://img.shields.io/badge/Version-0.3.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square) +![Version: 0.3.5](https://img.shields.io/badge/Version-0.3.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square) A Helm chart to install ODF on Openshift ### Notable changes +* v0.3.5: Add a `status: true` to podFailure specifications for <= 4.20 + compatibility. The field is mandatory in <= 4.20, and still + accepted in later versions. + * v0.3.4: Add a `job-wait-for-mcp` Job (sync-wave -2, before the node-labeling Job at -1 and the StorageCluster) that waits for the configured MachineConfigPools (default: `worker`) to finish reconciling before diff --git a/README.md.gotmpl b/README.md.gotmpl index cd1945c..9bb16f9 100644 --- a/README.md.gotmpl +++ b/README.md.gotmpl @@ -7,6 +7,10 @@ ### Notable changes +* v0.3.5: Add a `status: true` to podFailure specifications for <= 4.20 + compatibility. The field is mandatory in <= 4.20, and still + accepted in later versions. + * v0.3.4: Add a `job-wait-for-mcp` Job (sync-wave -2, before the node-labeling Job at -1 and the StorageCluster) that waits for the configured MachineConfigPools (default: `worker`) to finish reconciling before diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index a165d41..e91cc69 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -25,6 +25,23 @@ standard-csi {{- end -}} {{- end -}} +{{/* +Pod failure policy shared by the label-storage-nodes Job and CronJob. +*/}} +{{- define "odf.labelStorageNodes.podFailurePolicy" -}} +podFailurePolicy: + rules: + - action: Ignore + onExitCodes: + containerName: label-storage-nodes + operator: In + values: [143] + - action: Ignore + onPodConditions: + - type: DisruptionTarget + status: "True" +{{- end }} + {{/* Bash script used by the label-storage-nodes Job and CronJob. Respects storageSystem.inventory.useSpecificNodes vs nodeJobLabelSelector. diff --git a/templates/cronjob-labelNodes.yaml b/templates/cronjob-labelNodes.yaml index 21835ea..b6a7a52 100644 --- a/templates/cronjob-labelNodes.yaml +++ b/templates/cronjob-labelNodes.yaml @@ -14,16 +14,7 @@ spec: spec: # A drain-evicted (cancelled) pod is ignored rather than counted as a # failure; only genuine failures count toward backoffLimit. - podFailurePolicy: - rules: - - action: Ignore - onExitCodes: - containerName: label-storage-nodes - operator: In - values: [143] - - action: Ignore - onPodConditions: - - type: DisruptionTarget + {{- include "odf.labelStorageNodes.podFailurePolicy" . | nindent 6 }} template: spec: {{- include "odf.labelStorageNodes.podSpec" . | nindent 10 }} diff --git a/templates/job-labelNodes.yaml b/templates/job-labelNodes.yaml index 9c89349..83dc0b9 100644 --- a/templates/job-labelNodes.yaml +++ b/templates/job-labelNodes.yaml @@ -9,16 +9,7 @@ spec: # A drain-evicted (cancelled) pod is ignored rather than counted as a # failure: the Job stays incomplete and a replacement pod retries the # labeling. Only genuine failures count toward backoffLimit. - podFailurePolicy: - rules: - - action: Ignore - onExitCodes: - containerName: label-storage-nodes - operator: In - values: [143] - - action: Ignore - onPodConditions: - - type: DisruptionTarget + {{- include "odf.labelStorageNodes.podFailurePolicy" . | nindent 2 }} template: spec: {{- include "odf.labelStorageNodes.podSpec" . | nindent 6 }} diff --git a/templates/job-waitForMcp.yaml b/templates/job-waitForMcp.yaml index c5c2173..015484d 100644 --- a/templates/job-waitForMcp.yaml +++ b/templates/job-waitForMcp.yaml @@ -20,6 +20,7 @@ spec: - action: Ignore onPodConditions: - type: DisruptionTarget + status: "True" template: spec: {{- include "odf.waitForMcp.podSpec" . | nindent 6 }} diff --git a/tests/cronjob_labelNodes_test.yaml b/tests/cronjob_labelNodes_test.yaml index 36ea049..0e1edea 100644 --- a/tests/cronjob_labelNodes_test.yaml +++ b/tests/cronjob_labelNodes_test.yaml @@ -17,6 +17,12 @@ tests: - equal: path: spec.concurrencyPolicy value: Forbid + - 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.serviceAccountName value: odf-node-label-sa diff --git a/tests/job_waitForMcp_test.yaml b/tests/job_waitForMcp_test.yaml index f66ffd9..fcf99d6 100644 --- a/tests/job_waitForMcp_test.yaml +++ b/tests/job_waitForMcp_test.yaml @@ -62,6 +62,9 @@ tests: - equal: path: spec.podFailurePolicy.rules[1].onPodConditions[0].type value: DisruptionTarget + - equal: + path: spec.podFailurePolicy.rules[1].onPodConditions[0].status + value: "True" - it: Should support custom pools and timeout