Skip to content

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

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:masterfrom
BhargaviGudi:fix-storage-path-ref-suffix
Apr 20, 2026
Merged

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

Conversation

@BhargaviGudi
Copy link
Copy Markdown
Contributor

@BhargaviGudi BhargaviGudi commented Apr 15, 2026

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)

Verified manually

$ cat containerruntie-layerstores.yaml 
apiVersion: machineconfiguration.openshift.io/v1
kind: ContainerRuntimeConfig
metadata:
  name: additional-layer-stores
spec:
  machineConfigPoolSelector:
    matchLabels:
      pools.operator.machineconfiguration.openshift.io/worker: ""
  containerRuntimeConfig:
    additionalLayerStores:
      - path: /var/lib/stargz-store/store:ref
$ oc create -f containerruntie-layerstores.yaml 
containerruntimeconfig.machineconfiguration.openshift.io/additional-layer-stores created
$ oc get containerruntimeconfigs.machineconfiguration.openshift.io 
NAME                      AGE
additional-layer-stores   8s

@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

📝 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.
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.
Description check ✅ Passed The PR description comprehensively explains the problem (API rejects :ref suffix in additionalLayerStores paths), the solution (new LayerStorePath type), implementation details, testing approach, and links to the upstream stargz-snapshotter documentation and related issue OCPBUGS-83492.

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

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

@BhargaviGudi
Copy link
Copy Markdown
Contributor 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
Contributor 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
Contributor 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
Contributor 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
@BhargaviGudi
Copy link
Copy Markdown
Contributor Author

/pipeline required

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-ovn
/test e2e-aws-ovn-hypershift
/test e2e-aws-ovn-hypershift-conformance
/test e2e-aws-ovn-techpreview
/test e2e-aws-serial-1of2
/test e2e-aws-serial-2of2
/test e2e-aws-serial-techpreview-1of2
/test e2e-aws-serial-techpreview-2of2
/test e2e-azure
/test e2e-gcp
/test e2e-upgrade
/test e2e-upgrade-out-of-change
/test minor-e2e-upgrade-minor

@BhargaviGudi
Copy link
Copy Markdown
Contributor Author

/test e2e-aws-ovn-hypershift-conformance
/test e2e-upgrade

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.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 17, 2026
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 17, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: everettraven

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

The pull request process is described 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 17, 2026
@openshift-ci-robot
Copy link
Copy Markdown

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

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 POST, 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:

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)

Verified manually

$ cat containerruntie-layerstores.yaml
apiVersion: machineconfiguration.openshift.io/v1
kind: ContainerRuntimeConfig
metadata:
name: additional-layer-stores
spec:
machineConfigPoolSelector:
matchLabels:
pools.operator.machineconfiguration.openshift.io/worker: ""
containerRuntimeConfig:
additionalLayerStores:
- path: /var/lib/stargz-store/store:ref
$ oc create -f containerruntie-layerstores.yaml
containerruntimeconfig.machineconfiguration.openshift.io/additional-layer-stores created
$ oc get containerruntimeconfigs.machineconfiguration.openshift.io
NAME AGE
additional-layer-stores 8s


- All 4627 API validation tests pass
- API validation passed - CRD accepted the :ref suffix
- MCO controller REJECTED it with error:
 `Error: invalid AdditionalLayerStores path "/var/lib/stargz-store/store:ref": must be an absolute path containing only alphanumeric characters, '/', '.', '_', and '-'`
- This will be addressed throgh https://github.com/openshift/machine-config-operator/pull/5858


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
Contributor Author

/verified by @BhargaviGudi

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Apr 20, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@BhargaviGudi: This PR has been marked as verified by @BhargaviGudi.

Details

In response to this:

/verified by @BhargaviGudi

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-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 20, 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.

@openshift-merge-bot openshift-merge-bot Bot merged commit 47e56c7 into openshift:master Apr 20, 2026
29 checks passed
@openshift-ci-robot
Copy link
Copy Markdown

@BhargaviGudi: Jira Issue OCPBUGS-83492: Some pull requests linked via external trackers have merged:

The following pull request, linked via external tracker, has not merged:

All associated pull requests must be merged or unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

Jira Issue OCPBUGS-83492 has not been moved to the MODIFIED state.

This PR is marked as verified. If the remaining PRs listed above are marked as verified before merging, the issue will automatically be moved to VERIFIED after all of the changes from the PRs are available in an accepted nightly payload.

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)

Verified manually

$ cat containerruntie-layerstores.yaml
apiVersion: machineconfiguration.openshift.io/v1
kind: ContainerRuntimeConfig
metadata:
name: additional-layer-stores
spec:
machineConfigPoolSelector:
matchLabels:
pools.operator.machineconfiguration.openshift.io/worker: ""
containerRuntimeConfig:
additionalLayerStores:
- path: /var/lib/stargz-store/store:ref
$ oc create -f containerruntie-layerstores.yaml
containerruntimeconfig.machineconfiguration.openshift.io/additional-layer-stores created
$ oc get containerruntimeconfigs.machineconfiguration.openshift.io
NAME AGE
additional-layer-stores 8s


- All 4627 API validation tests pass
- API validation passed - CRD accepted the :ref suffix
- MCO controller REJECTED it with error:
 `Error: invalid AdditionalLayerStores path "/var/lib/stargz-store/store:ref": must be an absolute path containing only alphanumeric characters, '/', '.', '_', and '-'`
- This will be addressed throgh https://github.com/openshift/machine-config-operator/pull/5858


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
Contributor Author

/cherry-pick release-4.22

@openshift-cherrypick-robot
Copy link
Copy Markdown

@BhargaviGudi: new pull request created: #2818

Details

In response to this:

/cherry-pick release-4.22

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.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. 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. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants