|
| 1 | +suite: removing an inherited env key — null deletion, and why "" does not work |
| 2 | +release: |
| 3 | + name: t |
| 4 | + namespace: sim |
| 5 | +defaults: &defaults |
| 6 | + app.env.BETTER_AUTH_SECRET: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| 7 | + app.env.ENCRYPTION_KEY: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| 8 | + app.env.INTERNAL_API_SECRET: x |
| 9 | + app.env.CRON_SECRET: x |
| 10 | + postgresql.auth.password: xxxxxxxx |
| 11 | +tests: |
| 12 | + - it: baseline — a preset envDefaults cap is inlined on the app pod |
| 13 | + template: deployment-app.yaml |
| 14 | + values: |
| 15 | + - values/preset-free-limits.yaml |
| 16 | + set: |
| 17 | + <<: *defaults |
| 18 | + asserts: |
| 19 | + - contains: |
| 20 | + path: spec.template.spec.containers[0].env |
| 21 | + content: |
| 22 | + name: FREE_TABLES_LIMIT |
| 23 | + value: "3" |
| 24 | + - contains: |
| 25 | + path: spec.template.spec.containers[0].env |
| 26 | + content: |
| 27 | + name: FREE_TABLE_ROWS_LIMIT |
| 28 | + value: "1000" |
| 29 | + |
| 30 | + - it: an empty string does NOT clear an envDefaults key — it reads as "unspecified" |
| 31 | + template: deployment-app.yaml |
| 32 | + values: |
| 33 | + - values/preset-free-limits.yaml |
| 34 | + set: |
| 35 | + <<: *defaults |
| 36 | + app.env.FREE_TABLES_LIMIT: "" |
| 37 | + asserts: |
| 38 | + - contains: |
| 39 | + path: spec.template.spec.containers[0].env |
| 40 | + content: |
| 41 | + name: FREE_TABLES_LIMIT |
| 42 | + value: "3" |
| 43 | + |
| 44 | + - it: null removes the key from the inlined envDefaults |
| 45 | + template: deployment-app.yaml |
| 46 | + values: |
| 47 | + - values/preset-free-limits.yaml |
| 48 | + - values/unset-free-limits.yaml |
| 49 | + set: |
| 50 | + <<: *defaults |
| 51 | + asserts: |
| 52 | + - notContains: |
| 53 | + path: spec.template.spec.containers[0].env |
| 54 | + content: |
| 55 | + name: FREE_TABLES_LIMIT |
| 56 | + value: "3" |
| 57 | + - notContains: |
| 58 | + path: spec.template.spec.containers[0].env |
| 59 | + content: |
| 60 | + name: FREE_TABLE_ROWS_LIMIT |
| 61 | + value: "1000" |
| 62 | + |
| 63 | + - it: null removes an app.env key from the chart-managed Secret |
| 64 | + template: secrets-app.yaml |
| 65 | + values: |
| 66 | + - values/preset-free-limits.yaml |
| 67 | + - values/unset-free-limits.yaml |
| 68 | + set: |
| 69 | + <<: *defaults |
| 70 | + asserts: |
| 71 | + - isNull: |
| 72 | + path: stringData.FREE_STORAGE_LIMIT_GB |
| 73 | + |
| 74 | + - it: the app.env key is present in the Secret before it is nulled |
| 75 | + template: secrets-app.yaml |
| 76 | + values: |
| 77 | + - values/preset-free-limits.yaml |
| 78 | + set: |
| 79 | + <<: *defaults |
| 80 | + asserts: |
| 81 | + - equal: |
| 82 | + path: stringData.FREE_STORAGE_LIMIT_GB |
| 83 | + value: "5" |
| 84 | + |
| 85 | + - it: nulling unrelated keys leaves the rest of envDefaults intact |
| 86 | + template: deployment-app.yaml |
| 87 | + values: |
| 88 | + - values/preset-free-limits.yaml |
| 89 | + - values/unset-free-limits.yaml |
| 90 | + set: |
| 91 | + <<: *defaults |
| 92 | + asserts: |
| 93 | + - contains: |
| 94 | + path: spec.template.spec.containers[0].env |
| 95 | + content: |
| 96 | + name: BETTER_AUTH_URL |
| 97 | + value: http://localhost:3000 |
| 98 | + - contains: |
| 99 | + path: spec.template.spec.containers[0].env |
| 100 | + content: |
| 101 | + name: BILLING_CONCURRENCY_LIMIT_FREE |
| 102 | + value: "10" |
| 103 | + |
| 104 | + - it: nulling a boot-critical key is still refused by the existing validator |
| 105 | + values: |
| 106 | + - values/preset-free-limits.yaml |
| 107 | + set: |
| 108 | + <<: *defaults |
| 109 | + app.env.ENCRYPTION_KEY: null |
| 110 | + asserts: |
| 111 | + - failedTemplate: |
| 112 | + errorMessage: app.env.ENCRYPTION_KEY is required for production deployment |
0 commit comments