|
| 1 | +suite: pod rollout — checksum annotations + topology spread |
| 2 | +release: |
| 3 | + name: t |
| 4 | + namespace: sim |
| 5 | +defaults: &defaults |
| 6 | + app.env.BETTER_AUTH_SECRET: x |
| 7 | + app.env.ENCRYPTION_KEY: x |
| 8 | + app.env.INTERNAL_API_SECRET: x |
| 9 | + app.env.CRON_SECRET: x |
| 10 | + postgresql.auth.password: x |
| 11 | + |
| 12 | +tests: |
| 13 | + - it: app pod template has checksum/secret annotation |
| 14 | + template: deployment-app.yaml |
| 15 | + set: |
| 16 | + <<: *defaults |
| 17 | + asserts: |
| 18 | + - isNotEmpty: |
| 19 | + path: spec.template.metadata.annotations["checksum/secret"] |
| 20 | + |
| 21 | + - it: realtime pod template has checksum/secret annotation |
| 22 | + template: deployment-realtime.yaml |
| 23 | + set: |
| 24 | + <<: *defaults |
| 25 | + asserts: |
| 26 | + - isNotEmpty: |
| 27 | + path: spec.template.metadata.annotations["checksum/secret"] |
| 28 | + |
| 29 | + - it: changing a secret value changes the app pod checksum (forces rollout) |
| 30 | + template: deployment-app.yaml |
| 31 | + set: |
| 32 | + <<: *defaults |
| 33 | + app.env.BETTER_AUTH_SECRET: original-value |
| 34 | + asserts: |
| 35 | + - notEqual: |
| 36 | + path: spec.template.metadata.annotations["checksum/secret"] |
| 37 | + value: "" |
| 38 | + |
| 39 | + - it: topologySpreadConstraints render on the app pod when set |
| 40 | + template: deployment-app.yaml |
| 41 | + set: |
| 42 | + <<: *defaults |
| 43 | + topologySpreadConstraints: |
| 44 | + - maxSkew: 1 |
| 45 | + topologyKey: topology.kubernetes.io/zone |
| 46 | + whenUnsatisfiable: ScheduleAnyway |
| 47 | + labelSelector: |
| 48 | + matchLabels: |
| 49 | + app.kubernetes.io/name: sim |
| 50 | + asserts: |
| 51 | + - equal: |
| 52 | + path: spec.template.spec.topologySpreadConstraints[0].topologyKey |
| 53 | + value: topology.kubernetes.io/zone |
| 54 | + - equal: |
| 55 | + path: spec.template.spec.topologySpreadConstraints[0].whenUnsatisfiable |
| 56 | + value: ScheduleAnyway |
| 57 | + |
| 58 | + - it: topologySpreadConstraints render on the realtime pod when set |
| 59 | + template: deployment-realtime.yaml |
| 60 | + set: |
| 61 | + <<: *defaults |
| 62 | + topologySpreadConstraints: |
| 63 | + - maxSkew: 1 |
| 64 | + topologyKey: topology.kubernetes.io/zone |
| 65 | + whenUnsatisfiable: ScheduleAnyway |
| 66 | + labelSelector: |
| 67 | + matchLabels: |
| 68 | + app.kubernetes.io/name: sim |
| 69 | + asserts: |
| 70 | + - equal: |
| 71 | + path: spec.template.spec.topologySpreadConstraints[0].topologyKey |
| 72 | + value: topology.kubernetes.io/zone |
0 commit comments