fix: support staffbase-application Helm chart image field shape#139
Merged
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
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
094516a to
f80c00a
Compare
monotek
approved these changes
May 28, 2026
Assisted-by: pi:claude-sonnet-4-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Some Helm chart splits the image into a mapping:
When the 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 template renders{{ .image.repository }}:{{ .image.tag }}as:— both fields resolve to empty.Fix
Three-case dispatch in
update_file():Case 1 — legacy (Apperator): field resolves to a scalar → write full image URI unchanged. No behaviour change for existing callers.
Case 2 — auto-detect (Helm): field resolves to a
!!mapwith a.tagproperty → write onlyINPUT_TAGto.field.tag. Caller specifiesspec.values.workload.container.image, action handles the rest.Case 3 — explicit: field path ends in
.tag→ write onlyINPUT_TAGdirectly to that field. For callers who prefer to be explicit.Backwards compatibility
All existing Apperator-style callers have scalar image fields and continue to receive the full URI unchanged (case 1). No
cicd.ymlchanges required for existing services.