Skip to content

Allow hub side templating for image pre-caching. - #919

Open
yprokule wants to merge 1 commit into
openshift-kni:mainfrom
yprokule:pre-caching-templating
Open

Allow hub side templating for image pre-caching.#919
yprokule wants to merge 1 commit into
openshift-kni:mainfrom
yprokule:pre-caching-templating

Conversation

@yprokule

Copy link
Copy Markdown
Contributor

Hub side templating in a form of:

  pinnedImages: '{{hub fromConfigMap "" "pinned-imagesets" "controlplane-release-images" | toLiteral hub}}'

fails as kustomize fails to apply patches:

  wrong node kind: expected MappingNode but got ScalarNode:

Root cause: the base CR has pinnedImages: {} (a mapping). The hub template is a string (scalar).
Kustomize strategic-merge patches cannot change node kind (MappingNode → ScalarNode), so the build fails even with the correct template syntax.

ConfigMap looks like:

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: pinned-imagesets
  namespace: ztp-core-policies
data:
  controlplane-release-images: '[{"name": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:abc.."},
    {"name": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:cde.."},
    {"name": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:1234..."},

Hub side templating in a form of:

  pinnedImages: '{{hub fromConfigMap "" "pinned-imagesets" "controlplane-release-images" | toLiteral hub}}'

fails as kustomize fails to apply patches:
  wrong node kind: expected MappingNode but got ScalarNode:

Root cause: the base CR has pinnedImages: {} (a mapping).
The hub template is a string (scalar).
Kustomize strategic-merge patches cannot change node kind
(MappingNode → ScalarNode), so the build fails even with the correct template syntax.

Signed-off-by: Yurii Prokulevych <yprokule@redhat.com>
@openshift-ci
openshift-ci Bot requested a review from cgoncalves August 20, 2026 11:06
@openshift-ci

openshift-ci Bot commented Aug 20, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yprokule
Once this PR has been reviewed and has the lgtm label, please assign imiller0 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
openshift-ci Bot requested a review from fedepaol August 20, 2026 11:06
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 19900083-de45-4476-84af-3768aea8964e

📥 Commits

Reviewing files that changed from the base of the PR and between ab8f2cf and 47243f5.

📒 Files selected for processing (4)
  • telco-core/configuration/reference-crs/optional/other/precache/controlplane-olm-pinned-images.yaml
  • telco-core/configuration/reference-crs/optional/other/precache/controlplane-releases-pinned-images.yaml
  • telco-core/configuration/reference-crs/optional/other/precache/worker-olm-pinned-images.yaml
  • telco-core/configuration/reference-crs/optional/other/precache/worker-releases-pinned-images.yaml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The four precache reference configurations change pinnedImages from empty objects to empty strings for control plane and worker OLM and release image sets.

Changes

Precache pinned image configurations

Layer / File(s) Summary
Update pinned image placeholders
telco-core/configuration/reference-crs/optional/other/precache/*-pinned-images.yaml
The four PinnedImageSet configurations now use empty strings for pinnedImages.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 47243

This localized configuration change is merge-ready after normal checks and review, with no actionable merge-blocking risk remaining.

Suggested reviewers: cgoncalves, fedepaol

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the Kustomize node-type failure and the hub-side templating change.
Title check ✅ Passed The title clearly and concisely identifies the main change: enabling hub-side templating for image pre-caching.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@yprokule

Copy link
Copy Markdown
Contributor Author

/assign @imiller0
/cc @alosadagrande

# your target release(s). Use patches in the PolicyGenerator to override
# this list with environment-specific image digests.
pinnedImages: {}
pinnedImages: ""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the correct form here would be an empty list, eg []. The object/dict definitely isn't correct...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants