-
Notifications
You must be signed in to change notification settings - Fork 587
WIP: OCPNODE-4060: Add additional storage configuration fields to ContainerRuntimeConfig #2681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
saschagrunert
wants to merge
1
commit into
openshift:master
Choose a base branch
from
saschagrunert:additional-storage-config-crio
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
248 changes: 248 additions & 0 deletions
248
...ts/containerruntimeconfigs.machineconfiguration.openshift.io/AdditionalStorageConfig.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,248 @@ | ||
| apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this | ||
| name: "ContainerRuntimeConfig" | ||
| crdName: containerruntimeconfigs.machineconfiguration.openshift.io | ||
| featureGates: | ||
| - AdditionalStorageConfig | ||
| tests: | ||
| onCreate: | ||
| # AdditionalLayerStores - comprehensive validation tests | ||
| - name: Should be able to create ContainerRuntimeConfig with multiple additionalLayerStores | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalLayerStores: | ||
| - path: /var/lib/stargz-store | ||
| - path: /mnt/nydus-store | ||
| - path: /opt/layer_store-v1.0 | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalLayerStores: | ||
| - path: /var/lib/stargz-store | ||
| - path: /mnt/nydus-store | ||
| - path: /opt/layer_store-v1.0 | ||
|
|
||
| - name: Should fail if additionalLayerStores path is empty | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalLayerStores: | ||
| - path: "" | ||
| expectedError: "path in body should be at least 1 chars long" | ||
|
|
||
| - name: Should fail if additionalLayerStores path is not absolute | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalLayerStores: | ||
| - path: var/lib/stargz-store | ||
| expectedError: "path must be absolute and contain only alphanumeric characters, '/', '.', '_', and '-'" | ||
|
|
||
| - name: Should fail if additionalLayerStores path contains spaces | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalLayerStores: | ||
| - path: /var/lib/stargz store | ||
| expectedError: "path must be absolute and contain only alphanumeric characters, '/', '.', '_', and '-'" | ||
|
|
||
| - name: Should fail if additionalLayerStores path contains invalid characters | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalLayerStores: | ||
| - path: /var/lib/stargz@store | ||
| expectedError: "path must be absolute and contain only alphanumeric characters, '/', '.', '_', and '-'" | ||
|
|
||
| - name: Should fail if additionalLayerStores path is too long | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalLayerStores: | ||
| - path: /aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | ||
| expectedError: "Too long: may not be more than 256 bytes" | ||
|
|
||
| - name: Should fail if additionalLayerStores exceeds maximum of 5 items | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalLayerStores: | ||
| - path: /var/lib/store1 | ||
| - path: /var/lib/store2 | ||
| - path: /var/lib/store3 | ||
| - path: /var/lib/store4 | ||
| - path: /var/lib/store5 | ||
| - path: /var/lib/store6 | ||
| expectedError: "Too many: 6: must have at most 5 items" | ||
|
|
||
| - name: Should fail if additionalLayerStores item has no path field | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalLayerStores: | ||
| - {} | ||
| expectedError: "path: Required value" | ||
|
|
||
| - name: Should fail if additionalLayerStores contains duplicate paths | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalLayerStores: | ||
| - path: /var/lib/stargz-store | ||
| - path: /var/lib/stargz-store | ||
| expectedError: "additionalLayerStores must not contain duplicate paths" | ||
|
|
||
| # AdditionalImageStores - test max items validation (different from layer stores) | ||
| - name: Should fail if additionalImageStores exceeds maximum of 10 items | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalImageStores: | ||
| - path: /var/lib/store1 | ||
| - path: /var/lib/store2 | ||
| - path: /var/lib/store3 | ||
| - path: /var/lib/store4 | ||
| - path: /var/lib/store5 | ||
| - path: /var/lib/store6 | ||
| - path: /var/lib/store7 | ||
| - path: /var/lib/store8 | ||
| - path: /var/lib/store9 | ||
| - path: /var/lib/store10 | ||
| - path: /var/lib/store11 | ||
| expectedError: "Too many: 11: must have at most 10 items" | ||
|
|
||
| - name: Should fail if additionalImageStores path is not absolute | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalImageStores: | ||
| - path: var/lib/images | ||
| expectedError: "path must be absolute and contain only alphanumeric characters, '/', '.', '_', and '-'" | ||
|
|
||
| - name: Should fail if additionalImageStores item has no path field | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalImageStores: | ||
| - {} | ||
| expectedError: "path: Required value" | ||
|
|
||
| - name: Should fail if additionalImageStores contains duplicate paths | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalImageStores: | ||
| - path: /mnt/nfs-images | ||
| - path: /mnt/nfs-images | ||
| expectedError: "additionalImageStores must not contain duplicate paths" | ||
|
|
||
| # AdditionalArtifactStores - test max items validation (different from layer stores) | ||
| - name: Should fail if additionalArtifactStores exceeds maximum of 10 items | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalArtifactStores: | ||
| - path: /var/lib/store1 | ||
| - path: /var/lib/store2 | ||
| - path: /var/lib/store3 | ||
| - path: /var/lib/store4 | ||
| - path: /var/lib/store5 | ||
| - path: /var/lib/store6 | ||
| - path: /var/lib/store7 | ||
| - path: /var/lib/store8 | ||
| - path: /var/lib/store9 | ||
| - path: /var/lib/store10 | ||
| - path: /var/lib/store11 | ||
| expectedError: "Too many: 11: must have at most 10 items" | ||
|
|
||
| - name: Should fail if additionalArtifactStores path is not absolute | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalArtifactStores: | ||
| - path: var/lib/artifacts | ||
| expectedError: "path must be absolute and contain only alphanumeric characters, '/', '.', '_', and '-'" | ||
|
|
||
| - name: Should fail if additionalArtifactStores item has no path field | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalArtifactStores: | ||
| - {} | ||
| expectedError: "path: Required value" | ||
|
|
||
| - name: Should fail if additionalArtifactStores contains duplicate paths | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| additionalArtifactStores: | ||
| - path: /mnt/ssd-artifacts | ||
| - path: /mnt/ssd-artifacts | ||
| expectedError: "additionalArtifactStores must not contain duplicate paths" | ||
|
|
||
| # Combined test - all storage types together with other fields | ||
| - name: Should be able to create ContainerRuntimeConfig with all storage types and existing fields | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| defaultRuntime: crun | ||
| logLevel: info | ||
| additionalLayerStores: | ||
| - path: /var/lib/stargz-store | ||
| additionalImageStores: | ||
| - path: /mnt/nfs-images | ||
| - path: /mnt/ssd-images | ||
| additionalArtifactStores: | ||
| - path: /mnt/ssd-artifacts | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: ContainerRuntimeConfig | ||
| spec: | ||
| containerRuntimeConfig: | ||
| defaultRuntime: crun | ||
| logLevel: info | ||
| additionalLayerStores: | ||
| - path: /var/lib/stargz-store | ||
| additionalImageStores: | ||
| - path: /mnt/nfs-images | ||
| - path: /mnt/ssd-images | ||
| additionalArtifactStores: | ||
| - path: /mnt/ssd-artifacts |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.