Commit a90b1cb
authored
fix: support staffbase-application Helm chart image field shape (#139)
* fix: auto-detect image field type to support staffbase-application chart
The staffbase-application Helm chart splits the image into a mapping:
image:
repository: registry.staffbase.com/sb-images/app
tag: dev-abc123
When gitops-github-action writes the full URI as a scalar to
spec.values.workload.container.image, the kustomize patch replaces the
mapping with a string. The chart then renders 'image: :' — both
.image.repository and .image.tag resolve to empty.
Fix: before writing, read the type of the target field using yq.
- If the field is a mapping (!!map), write only INPUT_TAG to .field.tag
- Otherwise, write the full image URI as before (Apperator pattern)
Callers specifying spec.values.workload.container.image get the right
behaviour automatically based on what is already in their overlay file.
No changes to cicd.yml required.
Backwards compatible: all existing Apperator-style callers have scalar
image fields (!!str) and continue to receive the full URI unchanged.
Assisted-by: pi:claude-sonnet-4-5
* refactor: handle all image field shapes via explicit and auto-detection
Assisted-by: pi:claude-sonnet-4-51 parent da1135d commit a90b1cb
3 files changed
Lines changed: 56 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
40 | 50 | | |
41 | 51 | | |
42 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
54 | 86 | | |
55 | 87 | | |
56 | 88 | | |
| |||
0 commit comments