Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.*'
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions templates/agof-config-bootstrap-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
- action: Ignore
onPodConditions:
- type: DisruptionTarget
status: "True"
parallelism: 1
completions: 1
backoffLimit: 99
Expand Down
1 change: 1 addition & 0 deletions templates/agof-config-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ spec:
- action: Ignore
onPodConditions:
- type: DisruptionTarget
status: "True"
template:
spec:
activeDeadlineSeconds: {{ $.Values.configJob.activeDeadlineSeconds }}
Expand Down
1 change: 1 addition & 0 deletions templates/external-secrets-validation-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ spec:
- action: Ignore
onPodConditions:
- type: DisruptionTarget
status: "True"
parallelism: 1
completions: 1
backoffLimit: {{ $.Values.validationJob.backoffLimit }}
Expand Down
43 changes: 23 additions & 20 deletions tests/drain-cancelable_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
16 changes: 2 additions & 14 deletions tests/helm-values-cm_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Loading