Skip to content

OCPBUGS-83492: Allow :ref suffix in additionalLayerStores path for stargz-store to support lazy image pulling#2806

Open
BhargaviGudi wants to merge 1 commit intoopenshift:masterfrom
BhargaviGudi:fix-storage-path-ref-suffix
Open

OCPBUGS-83492: Allow :ref suffix in additionalLayerStores path for stargz-store to support lazy image pulling#2806
BhargaviGudi wants to merge 1 commit intoopenshift:masterfrom
BhargaviGudi:fix-storage-path-ref-suffix

Conversation

@BhargaviGudi
Copy link
Copy Markdown

Summary

Problem

  • ContainerRuntimeConfig API validation rejects the :ref suffix in additionalLayerStores paths, preventing proper configuration of stargz-store for lazy pulling functionality.

  • The path /var/lib/stargz-store/store:ref is required for stargz-store to work with CRI-O's additionalLayerStores mechanism, as documented in the upstream stargz-snapshotter installation guide.

    Current behavior:

    $ oc apply -f containerruntimeconfig-with-ref-suffix.yaml                                                                                                                                                         
    Error from server (Invalid): ContainerRuntimeConfig.machineconfiguration.openshift.io "additional-layer-stores" is invalid:                                                                                       
    spec.containerRuntimeConfig.additionalLayerStores[0].path: Invalid value: "/var/lib/stargz-store/store:ref":                                                                                                      
    path must be absolute and contain only alphanumeric characters, '/', '.', '_', and '-'                                                                                                                            
                                                                                                                                                                                                                      

Testing confirmed:

  • Without :ref: Lazy pulling does NOT work - images are pulled normally through CRI-O
  • With :ref: Lazy pulling works - layers are lazy-fetched through stargz-store, pods reuse cached snapshots

Solution

  • Introduced a new LayerStorePath type specifically for additionalLayerStores that allows paths ending with the :ref suffix, while keeping the existing StorePath type unchanged for additionalImageStores and additionalArtifactStores.

Changes:

  • Add LayerStorePath type with validation regex: ^/[a-zA-Z0-9/._-]+(:ref)?$
  • Update AdditionalLayerStore to use LayerStorePath instead of StorePath
  • Add test cases for :ref suffix validation (allow valid :ref, reject other suffixes like :other)
  • Update CRD manifests and swagger documentation

Testing
Test cases added to verify:

  1. Path with :ref suffix: /var/lib/stargz-store/store:ref
  2. Mixed paths (with and without :ref)
  3. Invalid suffix: /var/lib/stargz-store:other (must be exactly :ref)

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 15, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 15, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot openshift-ci-robot added the jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. label Apr 15, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 15, 2026

Hello @BhargaviGudi! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 15, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@BhargaviGudi: This pull request references Jira Issue OCPBUGS-83492, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

Problem

  • ContainerRuntimeConfig API validation rejects the :ref suffix in additionalLayerStores paths, preventing proper configuration of stargz-store for lazy pulling functionality.
  • The path /var/lib/stargz-store/store:ref is required for stargz-store to work with CRI-O's additionalLayerStores mechanism, as documented in the upstream stargz-snapshotter installation guide.

Current behavior:

$ oc apply -f containerruntimeconfig-with-ref-suffix.yaml                                                                                                                                                         
Error from server (Invalid): ContainerRuntimeConfig.machineconfiguration.openshift.io "additional-layer-stores" is invalid:                                                                                       
spec.containerRuntimeConfig.additionalLayerStores[0].path: Invalid value: "/var/lib/stargz-store/store:ref":                                                                                                      
path must be absolute and contain only alphanumeric characters, '/', '.', '_', and '-'                                                                                                                            
                                                                                                                                                                                                                  
Testing confirmed:                                                                                                                                                                                                
- Without :ref: Lazy pulling does NOT work - images are pulled normally through CRI-O                                                                                                                             
- With :ref: Lazy pulling works - layers are lazy-fetched through stargz-store, pods reuse cached snapshots

Solution
- Introduced a new LayerStorePath type specifically for additionalLayerStores that allows paths ending with the :ref suffix, while keeping the existing StorePath type unchanged for additionalImageStores and additionalArtifactStores.
                                                                                                                                                                                                                  
Changes:                                                                                                                                                                                                          
- Add LayerStorePath type with validation regex: ^/[a-zA-Z0-9/._-]+(:ref)?$
- Update AdditionalLayerStore to use LayerStorePath instead of StorePath                                                                                                                                          
- Add test cases for :ref suffix validation (allow valid :ref, reject other suffixes like :other)
- Update CRD manifests and swagger documentation                                                                                                                                                                  
                                                                                                                                                                                                                  
Testing
Test cases added to verify:
1. Path with :ref suffix: /var/lib/stargz-store/store:ref
2. Mixed paths (with and without :ref)                                                                                                                                                                         
3. Invalid suffix: /var/lib/stargz-store:other (must be exactly :ref)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 15, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 3b03324d-4324-407e-b28b-4fdcd120ee57

📥 Commits

Reviewing files that changed from the base of the PR and between 9abf08e and 590dfad.

⛔ Files ignored due to path filters (6)
  • machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_containerruntimeconfigs-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_containerruntimeconfigs-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_containerruntimeconfigs-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machineconfiguration/v1/zz_generated.featuregated-crd-manifests/containerruntimeconfigs.machineconfiguration.openshift.io/AdditionalStorageConfig.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • machineconfiguration/v1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
  • openapi/openapi.json is excluded by !openapi/**
📒 Files selected for processing (5)
  • machineconfiguration/v1/tests/containerruntimeconfigs.machineconfiguration.openshift.io/AdditionalStorageConfig.yaml
  • machineconfiguration/v1/types.go
  • payload-manifests/crds/0000_80_machine-config_01_containerruntimeconfigs-CustomNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_80_machine-config_01_containerruntimeconfigs-DevPreviewNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_80_machine-config_01_containerruntimeconfigs-TechPreviewNoUpgrade.crd.yaml
🚧 Files skipped from review as they are similar to previous changes (3)
  • payload-manifests/crds/0000_80_machine-config_01_containerruntimeconfigs-DevPreviewNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_80_machine-config_01_containerruntimeconfigs-TechPreviewNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_80_machine-config_01_containerruntimeconfigs-CustomNoUpgrade.crd.yaml

📝 Walkthrough

Walkthrough

Introduces a new Go type LayerStorePath and updates AdditionalLayerStore.Path to use it. The type enforces an absolute path (1–256 chars) composed of letters, digits, / . _ -, disallows consecutive //, and permits an optional trailing :ref. CRD OpenAPI/CEL validations in three manifest files were updated to allow the :ref suffix via the regex ^/[a-zA-Z0-9/._-]+(:ref)?$. Unit tests were added for positive :ref cases, mixed lists, and a negative case rejecting non-:ref suffixes.

🚥 Pre-merge checks | ✅ 9 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Test Structure And Quality ❓ Inconclusive Test files referenced in PR summary are not accessible in the current repository environment, preventing comprehensive quality assessment. Provide access to the actual test files (machineconfiguration/v1/tests/*.yaml and any Go test code) to assess test quality against single responsibility, setup/cleanup patterns, timeouts, assertions, and codebase consistency.
✅ Passed checks (9 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: allowing a :ref suffix in additionalLayerStores paths for stargz-store lazy image pulling, with the associated bug number.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about the problem, solution, implementation details, and testing approach for allowing :ref suffix in additionalLayerStores paths.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed All test names in AdditionalStorageConfig.yaml are stable and deterministic with clear descriptive names that remain unchanged across test runs. No dynamic values like timestamps, UUIDs, or random components are present in test names.
Microshift Test Compatibility ✅ Passed No Ginkgo e2e tests are added in this PR; changes are limited to YAML test cases and Go type definitions.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR adds only API type definitions, CRD schema validation rules, and declarative YAML-based schema validation tests with no Ginkgo e2e tests.
Topology-Aware Scheduling Compatibility ✅ Passed PR changes limited to API type definitions and CRD validation schema rules with no topology-aware scheduling concerns introduced.
Ote Binary Stdout Contract ✅ Passed PR contains only YAML test cases, CRD manifests, and type definitions with no stdout-writing process-level code modifications.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This pull request does not add any new Ginkgo e2e tests. Changes consist of API type definitions, CRD manifests, and YAML-based validation tests only.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

Error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented
The command is terminated due to an error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented


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 and usage tips.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 15, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign everettraven 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

@BhargaviGudi
Copy link
Copy Markdown
Author

/jira refresh

@openshift-ci-robot
Copy link
Copy Markdown

@BhargaviGudi: This pull request references Jira Issue OCPBUGS-83492, which is invalid:

  • expected the bug to target either version "5.0." or "openshift-5.0.", but it targets "4.22.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@machineconfiguration/v1/tests/containerruntimeconfigs.machineconfiguration.openshift.io/AdditionalStorageConfig.yaml`:
- Around line 103-114: Update the outdated expectedError strings in the
ContainerRuntimeConfig test cases that assert additionalLayerStores validation:
find the test entries referencing additionalLayerStores (look for the initial
YAML blocks under ContainerRuntimeConfig and the existing expectedError values)
and change the older message fragments ("path must be absolute and contain only
alphanumeric characters, '/', '.', '_', and '-'") to the new message including
the optional ':ref' wording ("path must be absolute and contain only
alphanumeric characters, '/', '.', '_', '-', and optionally end with ':ref'") so
they match LayerStorePath's current error output.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 5825084f-d1fd-4ab7-a6a1-9bff27fa4b7d

📥 Commits

Reviewing files that changed from the base of the PR and between 464776f and 942df24.

⛔ Files ignored due to path filters (5)
  • machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_containerruntimeconfigs-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_containerruntimeconfigs-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_containerruntimeconfigs-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • machineconfiguration/v1/zz_generated.featuregated-crd-manifests/containerruntimeconfigs.machineconfiguration.openshift.io/AdditionalStorageConfig.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • machineconfiguration/v1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
📒 Files selected for processing (5)
  • machineconfiguration/v1/tests/containerruntimeconfigs.machineconfiguration.openshift.io/AdditionalStorageConfig.yaml
  • machineconfiguration/v1/types.go
  • payload-manifests/crds/0000_80_machine-config_01_containerruntimeconfigs-CustomNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_80_machine-config_01_containerruntimeconfigs-DevPreviewNoUpgrade.crd.yaml
  • payload-manifests/crds/0000_80_machine-config_01_containerruntimeconfigs-TechPreviewNoUpgrade.crd.yaml

@BhargaviGudi
Copy link
Copy Markdown
Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 15, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@BhargaviGudi: This pull request references Jira Issue OCPBUGS-83492, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (bgudi@redhat.com), skipping review request.

Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@BhargaviGudi
Copy link
Copy Markdown
Author

/test all

@BhargaviGudi BhargaviGudi force-pushed the fix-storage-path-ref-suffix branch from 942df24 to 9abf08e Compare April 16, 2026 12:28
@BhargaviGudi
Copy link
Copy Markdown
Author

/retest-required

@BhargaviGudi BhargaviGudi marked this pull request as ready for review April 16, 2026 13:37
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 16, 2026
@openshift-ci openshift-ci bot requested review from JoelSpeed and jkyros April 16, 2026 13:37
Copy link
Copy Markdown
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

Aside from a small nit to make the godoc and the generated documentation read a bit better, this LGTM.

Comment thread machineconfiguration/v1/types.go Outdated
…upport lazy image pulling

Introduced LayerStorePath type for additionalLayerStores that allows paths ending with :ref (e.g., /var/lib/stargz-store/store:ref), while keeping StorePath unchanged for additionalImageStores and additionalArtifactStores.

Fixes: https://issues.redhat.com/browse/OCPBUGS-83492
@BhargaviGudi BhargaviGudi force-pushed the fix-storage-path-ref-suffix branch from 9abf08e to 590dfad Compare April 16, 2026 15:24
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 16, 2026

@BhargaviGudi: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants