OCPBUGS-83492: Allow :ref suffix in additionalLayerStores controller validation #5858
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5858"
general
weight: 0.35
BhargaviGudi
Allow :ref suffix in additionalLayerStores controller validation
Fixes: https://issues.redhat.com/browse/OCPBUGS-83492
- What I did
Added
validateLayerStorePath()function to allow the:refsuffix foradditionalLayerStorespaths, mirroring the API validation introduced in https://github.com/openshift/api/pull/2806.Changes:
layerStorePathRegexpregex:^/[a-zA-Z0-9/._-]+(:ref)?$validateLayerStorePath()function for layer store path validationvalidateUserContainerRuntimeConfig()to callvalidateLayerStorePath()foradditionalLayerStoresvalidateStorePath()unchanged foradditionalImageStoresandadditionalArtifactStoresWithout this fix, MCO controller rejects paths with
:refsuffix even after API CRD accepts them, preventing storage.conf generation and blocking lazy pulling.- How to verify it
1. Apply ContainerRuntimeConfig with
:refsuffix (requires API PR merged):yaml
2. Verify MCO accepts it (no Failure condition):
$ oc get containerruntimeconfig additional-layer-stores -o yaml | grep -A 5 "status:"
status:
conditions:
- lastTransitionTime: "2026-04-17T14:30:00Z"
status: "False"
type: Failure
3. Check generated storage.conf on worker node:
$ oc debug node/<worker> -- chroot /host cat /etc/containers/storage.conf | grep additionallayerstores
additionallayerstores = ["/var/lib/stargz-store/store:ref"]
4. Verify lazy pulling works with stargz-store (requires stargz-store setup)
Description for the changelog
Allow :ref suffix in additionalLayerStores controller validation for stargz-store lazy pulling support
Verified manually:
Tested with stargz-store on OpenShift 5.0.0:
``
bash
`# Applied ContainerRuntimeConfig with :ref suffix
$ oc get containerruntimeconfig additional-layer-stores -o yaml | grep -A 2 additionalLayerStores
additionalLayerStores:
- path: /var/lib/stargz-store/store:ref
# Success (both API and MCO accepted :ref)
# Verified /etc/containers/storage.conf updated on all worker nodes
$ oc debug node/$WORKER -- chroot /host cat /etc/containers/storage.conf | grep additionallayer
additionallayerstores = ["/var/lib/stargz-store/store:ref"]
# Tested lazy image pulling using estargz format image and verified snapshot created on the node
$ oc debug node/$WORKER -- chroot /host ls /var/lib/stargz-store/store/
cXVheS5pby9iZ3VkaS90ZXN0LXNtYWxsOmVzdGFyZ3o= # Snapshot created
# Tested layer reuse - second pod pull completed in <1 second using cached layers
$ oc debug node/$WORKER -- chroot /host journalctl -u stargz-store | grep refcounter
{"level":"info","msg":"layer quay.io/bgudi/test-small:estargz / sha256:8b0e... is marked as USING","refcounter":2}
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Bug Fixes
Improved container runtime configuration validation for layer store paths. Validator now properly handles paths with optional reference suffixes (:ref` format) while enforcing strict requirements for path structure and character sequences.
Validation for image store and artifact store configurations remains unchanged, maintaining backward compatibility.