Skip to content

Inherit Storage Class for Scratch Space PVCs#4054

Open
Dsanatar wants to merge 1 commit intokubevirt:mainfrom
Dsanatar:scratch-space-pvc-sc
Open

Inherit Storage Class for Scratch Space PVCs#4054
Dsanatar wants to merge 1 commit intokubevirt:mainfrom
Dsanatar:scratch-space-pvc-sc

Conversation

@Dsanatar
Copy link
Collaborator

What this PR does / why we need it:
There are some scenarios where we would like scratch space PVCs to use the same storage class as the associated target PVC instead of falling back to the default storage class.

This PR adds a new feature gate InheritScratchSpaceStorageClass which when enabled, allows scratch space PVCs to inherit the storage class from the target PVC.

The config controller currently looks to see that the config.Spec.ScratchSpaceStorageClass is set and if it is not, it will set it to the default storage class. However, now when this new feature gate is enabled, it will instead set it to be empty.

From here, there is existing code that checks to see if this ScratchSpaceStorageClass is not set, it will use the storage class from the owner PVC

storageClassName := config.Status.ScratchSpaceStorageClass
if storageClassName == "" {
// Unable to determine scratch storage class, attempt to read the storage class from the pvc.
if pvc.Spec.StorageClassName != nil {
storageClassName = *pvc.Spec.StorageClassName
if storageClassName != "" {
return storageClassName

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

add new InheritScratchSpaceStorageClass feature gate

…to inherit the storage class from the target resource instead of using the default sc

Signed-off-by: dsanatar <dsanatar@redhat.com>
@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Mar 10, 2026
@kubevirt-bot
Copy link
Contributor

[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 akalenyu 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

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

Labels

dco-signoff: yes Indicates the PR's author has DCO signed all their commits. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants