Skip to content

Conversation

@MatousJobanek
Copy link
Collaborator

@MatousJobanek MatousJobanek commented Dec 22, 2025

paired with codeready-toolchain/member-operator#719

Summary by CodeRabbit

  • New Features

    • Added DataVolume resource definition enabling persistent volume management within Kubernetes environments. Supports configurable data sources, storage specifications, preallocation settings, and checkpoint tracking for comprehensive volume operations.
  • Tests

    • Expanded test suite with DataVolume provisioning and deletion verification. Tests now validate complete resource lifecycle including pod ownership tracking and cleanup workflows.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 22, 2025

Walkthrough

Introduces a Kubernetes CustomResourceDefinition for DataVolume (cdi.kubevirt.io/v1beta1) and extends e2e test infrastructure to support DataVolume resource creation, ownership management, and cleanup verification during test execution.

Changes

Cohort / File(s) Summary
CRD Definition
deploy/crds/cdi.kubevirt.io_datavolumes.yaml
New namespaced CustomResourceDefinition for DataVolume resource. Defines comprehensive OpenAPI v3 schema with spec fields (preallocation, checkpoints, contentType, source, storage, pvc) and status fields (conditions, progress, restartCount, phase). Exposes status subresource and printer columns for Phase, Progress, Restarts, and Age.
Test Infrastructure
test/e2e/parallel/user_workloads_test.go
Extended test setup to create DataVolume resources alongside PVC and Pod with proper owner references. Added deletion verification step in cleanup flow to wait for DataVolume deletion alongside existing InferenceService cleanup.
Test Support Utilities
testsupport/wait/member.go
Added WaitUntilDataVolumeDeleted method to MemberAwaitility type. Mirrors existing deletion-wait pattern: polls with configured RetryInterval/Timeout, treats NotFound as success, returns errors for other failures.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • xcoulon
  • jrosental
  • fbm3307

Poem

🐰 A DataVolume hops into the test,
With PVCs and Pods all dressed in their best,
The CRD garden now blooms with new grace,
While cleanup waits patiently in its embrace! 📦

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'verify that DataVolume is idled' directly relates to the main changes: adding DataVolume resource support to the idler test suite, creating DataVolume test resources, and verifying their deletion during the idling workflow.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

return createPvcWithPod(t, memberAwait, name, namespace, createdDataVolume)
}

func createPvcWithPod(t *testing.T, memberAwait *wait.MemberAwaitility, name, namespace string, owner client.Object) *corev1.Pod {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this function is a preparation for upcoming PR that will support also deletion of PVCs (I found some pods that are owned by a PVC that doesn't have any owner)

@MatousJobanek
Copy link
Collaborator Author

MatousJobanek commented Dec 23, 2025

/retest
flaky - should be fixed by #1212

Copy link

@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

🤖 Fix all issues with AI agents
In @deploy/crds/cdi.kubevirt.io_datavolumes.yaml:
- Around line 1-659: The CRD file for DataVolume is missing a top-of-file
documentation comment indicating its upstream source and purpose; add a brief
comment at the very top of deploy/crds/cdi.kubevirt.io_datavolumes.yaml stating
that the CRD was sourced from the kubevirt/containerized-data-importer project
and that it is included here for e2e testing (follow the style used in other
CRDs in the directory), so reviewers can quickly identify origin and intent for
the DataVolume CRD.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b0408ed and e9d8720.

📒 Files selected for processing (3)
  • deploy/crds/cdi.kubevirt.io_datavolumes.yaml
  • test/e2e/parallel/user_workloads_test.go
  • testsupport/wait/member.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-01T09:51:30.271Z
Learnt from: fbm3307
Repo: codeready-toolchain/toolchain-e2e PR: 1175
File: testsupport/tiers/checks.go:1427-1608
Timestamp: 2025-08-01T09:51:30.271Z
Learning: In testsupport/tiers/checks.go, the go-prefixed cluster resource quota functions (like goClusterResourceQuotaDeployments, goClusterResourceQuotaReplicas, etc.) should be kept separate from their non-go counterparts, even though they appear similar. The maintainer prefers this separation for better code organization and to maintain clear boundaries between different tier implementations.

Applied to files:

  • test/e2e/parallel/user_workloads_test.go
🧬 Code graph analysis (2)
testsupport/wait/member.go (1)
testsupport/wait/awaitility.go (1)
  • RetryInterval (91-91)
test/e2e/parallel/user_workloads_test.go (2)
testsupport/wait/member.go (1)
  • MemberAwaitility (55-57)
setup/users/create_users.go (1)
  • Create (20-47)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build & push operator bundles & dashboard image for e2e tests
  • GitHub Check: GolangCI Lint
  • GitHub Check: Unit Tests
🔇 Additional comments (6)
testsupport/wait/member.go (1)

1560-1574: LGTM!

The implementation correctly mirrors the existing WaitUntilInferenceServiceDeleted pattern. The function properly handles the NotFound case as a success condition and propagates other errors appropriately.

test/e2e/parallel/user_workloads_test.go (5)

110-113: LGTM!

The DataVolume deletion verification is correctly placed in the test flow after the InferenceService deletion check, consistent with the other idler verification patterns.


169-171: LGTM!

The DataVolume creation and pod count increment follows the established pattern of other workload types in prepareWorkloads.


205-205: LGTM!

The GroupVersionResource declaration is consistent with the existing pattern and correctly matches the DataVolume CRD being added.


457-468: LGTM!

The minimal DataVolume resource with an empty spec is sufficient for testing the idler's ownership chain traversal, since the CDI controller isn't running in the test environment.


413-455: No action required. The use of SetOwnerReference with *unstructured.Unstructured objects is correct and standard practice in this codebase. This same pattern is successfully used for other external CRDs like AnsibleAutomationPlatform and ServingRuntime (lines 231, 500). The SetOwnerReference function from controller-runtime works with any object implementing the client.Object interface, which includes unstructured.Unstructured. Scheme registration is not required for metadata operations like setting owner references.

Likely an incorrect or invalid review comment.

Comment on lines +1 to +659
kind: CustomResourceDefinition
apiVersion: apiextensions.k8s.io/v1
metadata:
name: datavolumes.cdi.kubevirt.io
spec:
group: cdi.kubevirt.io
names:
plural: datavolumes
singular: datavolume
shortNames:
- dv
- dvs
kind: DataVolume
listKind: DataVolumeList
categories:
- all
scope: Namespaced
versions:
- name: v1beta1
served: true
storage: true
schema:
openAPIV3Schema:
description: DataVolume is an abstraction on top of PersistentVolumeClaims to allow easy population of those PersistentVolumeClaims with relation to VirtualMachines
type: object
required:
- spec
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: DataVolumeSpec defines the DataVolume type specification
type: object
properties:
preallocation:
description: Preallocation controls whether storage for DataVolumes should be allocated in advance.
type: boolean
checkpoints:
description: 'Checkpoints is a list of DataVolumeCheckpoints, representing stages in a multistage import.'
type: array
items:
description: DataVolumeCheckpoint defines a stage in a warm migration.
type: object
required:
- current
- previous
properties:
current:
description: Current is the identifier of the snapshot created for this checkpoint.
type: string
previous:
description: Previous is the identifier of the snapshot from the previous checkpoint.
type: string
contentType:
description: 'DataVolumeContentType options: "kubevirt", "archive"'
type: string
enum:
- kubevirt
- archive
sourceRef:
description: SourceRef is an indirect reference to the source of data for the requested DataVolume
type: object
required:
- kind
- name
properties:
kind:
description: 'The kind of the source reference, currently only "DataSource" is supported'
type: string
name:
description: The name of the source reference
type: string
namespace:
description: 'The namespace of the source reference, defaults to the DataVolume namespace'
type: string
source:
description: Source is the src of the data for the requested DataVolume
type: object
properties:
s3:
description: DataVolumeSourceS3 provides the parameters to create a Data Volume from an S3 source
type: object
required:
- url
properties:
certConfigMap:
description: 'CertConfigMap is a configmap reference, containing a Certificate Authority(CA) public key, and a base64 encoded pem certificate'
type: string
secretRef:
description: SecretRef provides the secret reference needed to access the S3 source
type: string
url:
description: URL is the url of the S3 source
type: string
upload:
description: DataVolumeSourceUpload provides the parameters to create a Data Volume by uploading the source
type: object
imageio:
description: DataVolumeSourceImageIO provides the parameters to create a Data Volume from an imageio source
type: object
required:
- diskId
- url
properties:
certConfigMap:
description: CertConfigMap provides a reference to the CA cert
type: string
diskId:
description: DiskID provides id of a disk to be imported
type: string
secretRef:
description: SecretRef provides the secret reference needed to access the ovirt-engine
type: string
url:
description: URL is the URL of the ovirt-engine
type: string
snapshot:
description: DataVolumeSourceSnapshot provides the parameters to create a Data Volume from an existing VolumeSnapshot
type: object
required:
- name
- namespace
properties:
name:
description: The name of the source VolumeSnapshot
type: string
namespace:
description: The namespace of the source VolumeSnapshot
type: string
http:
description: 'DataVolumeSourceHTTP can be either an http or https endpoint, with an optional basic auth user name and password, and an optional configmap containing additional CAs'
type: object
required:
- url
properties:
certConfigMap:
description: 'CertConfigMap is a configmap reference, containing a Certificate Authority(CA) public key, and a base64 encoded pem certificate'
type: string
extraHeaders:
description: ExtraHeaders is a list of strings containing extra headers to include with HTTP transfer requests
type: array
items:
type: string
secretExtraHeaders:
description: 'SecretExtraHeaders is a list of Secret references, each containing an extra HTTP header that may include sensitive information'
type: array
items:
type: string
secretRef:
description: 'SecretRef A Secret reference, the secret should contain accessKeyId (user name) base64 encoded, and secretKey (password) also base64 encoded'
type: string
url:
description: URL is the URL of the http(s) endpoint
type: string
blank:
description: DataVolumeBlankImage provides the parameters to create a new raw blank image for the PVC
type: object
vddk:
description: DataVolumeSourceVDDK provides the parameters to create a Data Volume from a Vmware source
type: object
properties:
backingFile:
description: BackingFile is the path to the virtual hard disk to migrate from vCenter/ESXi
type: string
extraArgs:
description: ExtraArgs is a reference to a ConfigMap containing extra arguments to pass directly to the VDDK library
type: string
initImageURL:
description: 'InitImageURL is an optional URL to an image containing an extracted VDDK library, overrides v2v-vmware config map'
type: string
secretRef:
description: SecretRef provides a reference to a secret containing the username and password needed to access the vCenter or ESXi host
type: string
thumbprint:
description: Thumbprint is the certificate thumbprint of the vCenter or ESXi host
type: string
url:
description: URL is the URL of the vCenter or ESXi host with the VM to migrate
type: string
uuid:
description: UUID is the UUID of the virtual machine that the backing file is attached to in vCenter/ESXi
type: string
gcs:
description: DataVolumeSourceGCS provides the parameters to create a Data Volume from an GCS source
type: object
required:
- url
properties:
secretRef:
description: SecretRef provides the secret reference needed to access the GCS source
type: string
url:
description: URL is the url of the GCS source
type: string
registry:
description: DataVolumeSourceRegistry provides the parameters to create a Data Volume from an registry source
type: object
properties:
certConfigMap:
description: CertConfigMap provides a reference to the Registry certs
type: string
imageStream:
description: ImageStream is the name of image stream for import
type: string
platform:
description: Platform describes the minimum runtime requirements of the image
type: object
properties:
architecture:
description: Architecture specifies the image target CPU architecture
type: string
pullMethod:
description: 'PullMethod can be either "pod" (default import), or "node" (node docker cache based import)'
type: string
secretRef:
description: SecretRef provides the secret reference needed to access the Registry source
type: string
url:
description: 'URL is the url of the registry source (starting with the scheme: docker, oci-archive)'
type: string
pvc:
description: DataVolumeSourcePVC provides the parameters to create a Data Volume from an existing PVC
type: object
required:
- name
- namespace
properties:
name:
description: The name of the source PVC
type: string
namespace:
description: The namespace of the source PVC
type: string
storage:
description: Storage is the requested storage specification
type: object
properties:
accessModes:
description: |-
AccessModes contains the desired access modes the volume should have.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
type: array
items:
type: string
dataSource:
description: |-
This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) * An existing custom resource that implements data population (Alpha) In order to use custom resource types that implement data population, the AnyVolumeDataSource feature gate must be enabled. If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source.
If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.
type: object
required:
- kind
- name
properties:
apiGroup:
description: |-
APIGroup is the group for the resource being referenced.
If APIGroup is not specified, the specified Kind must be in the core API group.
For any other third-party types, APIGroup is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
x-kubernetes-map-type: atomic
dataSourceRef:
description: |-
Specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner.
This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty.
There are two important differences between DataSource and DataSourceRef:
* While DataSource only allows two specific types of objects, DataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects.
* While DataSource ignores disallowed values (dropping them), DataSourceRef preserves all values, and generates an error if a disallowed value is specified.
(Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.
type: object
required:
- kind
- name
properties:
apiGroup:
description: |-
APIGroup is the group for the resource being referenced.
If APIGroup is not specified, the specified Kind must be in the core API group.
For any other third-party types, APIGroup is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
namespace:
description: |-
Namespace is the namespace of resource being referenced
Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.
(Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
type: string
resources:
description: |-
Resources represents the minimum resources the volume should have.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
type: object
properties:
limits:
description: |-
Limits describes the maximum amount of compute resources allowed.
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
type: object
additionalProperties:
pattern: '^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$'
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
requests:
description: |-
Requests describes the minimum amount of compute resources required.
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
otherwise to an implementation-defined value. Requests cannot exceed Limits.
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
type: object
additionalProperties:
pattern: '^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$'
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
selector:
description: A label query over volumes to consider for binding.
type: object
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements. The requirements are ANDed.
type: array
items:
description: |-
A label selector requirement is a selector that contains values, a key, and an operator that
relates the key and values.
type: object
required:
- key
- operator
properties:
key:
description: key is the label key that the selector applies to.
type: string
operator:
description: |-
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: |-
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
type: array
items:
type: string
x-kubernetes-list-type: atomic
x-kubernetes-list-type: atomic
matchLabels:
description: |-
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions, whose key field is "key", the
operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
additionalProperties:
type: string
x-kubernetes-map-type: atomic
storageClassName:
description: |-
Name of the StorageClass required by the claim.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
type: string
volumeMode:
description: |-
volumeMode defines what type of volume is required by the claim.
Value of Filesystem is implied when not included in claim spec.
type: string
volumeName:
description: VolumeName is the binding reference to the PersistentVolume backing this claim.
type: string
pvc:
description: PVC is the PVC specification
type: object
properties:
dataSource:
description: |-
dataSource field can be used to specify either:
* An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot)
* An existing PVC (PersistentVolumeClaim)
If the provisioner or an external controller can support the specified data source,
it will create a new volume based on the contents of the specified data source.
When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef,
and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified.
If the namespace is specified, then dataSourceRef will not be copied to dataSource.
type: object
required:
- kind
- name
properties:
apiGroup:
description: |-
APIGroup is the group for the resource being referenced.
If APIGroup is not specified, the specified Kind must be in the core API group.
For any other third-party types, APIGroup is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
x-kubernetes-map-type: atomic
volumeName:
description: volumeName is the binding reference to the PersistentVolume backing this claim.
type: string
resources:
description: |-
resources represents the minimum resources the volume should have.
If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements
that are lower than previous value but must still be higher than capacity recorded in the
status field of the claim.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
type: object
properties:
limits:
description: |-
Limits describes the maximum amount of compute resources allowed.
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
type: object
additionalProperties:
pattern: '^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$'
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
requests:
description: |-
Requests describes the minimum amount of compute resources required.
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
otherwise to an implementation-defined value. Requests cannot exceed Limits.
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
type: object
additionalProperties:
pattern: '^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$'
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
storageClassName:
description: |-
storageClassName is the name of the StorageClass required by the claim.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
type: string
accessModes:
description: |-
accessModes contains the desired access modes the volume should have.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
type: array
items:
type: string
x-kubernetes-list-type: atomic
dataSourceRef:
description: |-
dataSourceRef specifies the object from which to populate the volume with data, if a non-empty
volume is desired. This may be any object from a non-empty API group (non
core object) or a PersistentVolumeClaim object.
When this field is specified, volume binding will only succeed if the type of
the specified object matches some installed volume populator or dynamic
provisioner.
This field will replace the functionality of the dataSource field and as such
if both fields are non-empty, they must have the same value. For backwards
compatibility, when namespace isn't specified in dataSourceRef,
both fields (dataSource and dataSourceRef) will be set to the same
value automatically if one of them is empty and the other is non-empty.
When namespace is specified in dataSourceRef,
dataSource isn't set to the same value and must be empty.
There are three important differences between dataSource and dataSourceRef:
* While dataSource only allows two specific types of objects, dataSourceRef
allows any non-core object, as well as PersistentVolumeClaim objects.
* While dataSource ignores disallowed values (dropping them), dataSourceRef
preserves all values, and generates an error if a disallowed value is
specified.
* While dataSource only allows local objects, dataSourceRef allows objects
in any namespaces.
(Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.
(Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
type: object
required:
- kind
- name
properties:
apiGroup:
description: |-
APIGroup is the group for the resource being referenced.
If APIGroup is not specified, the specified Kind must be in the core API group.
For any other third-party types, APIGroup is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
namespace:
description: |-
Namespace is the namespace of resource being referenced
Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.
(Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
type: string
volumeAttributesClassName:
description: |-
volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim.
If specified, the CSI driver will create or update the volume with the attributes defined
in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName,
it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass
will be applied to the claim but it's not allowed to reset this field to empty string once it is set.
If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass
will be set by the persistentvolume controller if it exists.
If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
exists.
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
(Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.
type: string
volumeMode:
description: |-
volumeMode defines what type of volume is required by the claim.
Value of Filesystem is implied when not included in claim spec.
type: string
selector:
description: selector is a label query over volumes to consider for binding.
type: object
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements. The requirements are ANDed.
type: array
items:
description: |-
A label selector requirement is a selector that contains values, a key, and an operator that
relates the key and values.
type: object
required:
- key
- operator
properties:
key:
description: key is the label key that the selector applies to.
type: string
operator:
description: |-
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: |-
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
type: array
items:
type: string
x-kubernetes-list-type: atomic
x-kubernetes-list-type: atomic
matchLabels:
description: |-
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions, whose key field is "key", the
operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
additionalProperties:
type: string
x-kubernetes-map-type: atomic
finalCheckpoint:
description: FinalCheckpoint indicates whether the current DataVolumeCheckpoint is the final checkpoint.
type: boolean
priorityClassName:
description: 'PriorityClassName for Importer, Cloner and Uploader pod'
type: string
status:
description: DataVolumeStatus contains the current status of the DataVolume
type: object
properties:
claimName:
description: ClaimName is the name of the underlying PVC used by the DataVolume.
type: string
conditions:
type: array
items:
description: DataVolumeCondition represents the state of a data volume condition.
type: object
required:
- status
- type
properties:
lastHeartbeatTime:
type: string
format: date-time
lastTransitionTime:
type: string
format: date-time
message:
type: string
reason:
type: string
status:
type: string
type:
description: DataVolumeConditionType is the string representation of known condition types
type: string
phase:
description: Phase is the current phase of the data volume
type: string
progress:
description: 'DataVolumeProgress is the current progress of the DataVolume transfer operation. Value between 0 and 100 inclusive, N/A if not available'
type: string
restartCount:
description: RestartCount is the number of times the pod populating the DataVolume has restarted
type: integer
format: int32
subresources:
status: {}
additionalPrinterColumns:
- name: Phase
type: string
description: The phase the data volume is in
jsonPath: .status.phase
- name: Progress
type: string
description: 'Transfer progress in percentage if known, N/A otherwise'
jsonPath: .status.progress
- name: Restarts
type: integer
description: The number of times the transfer has been restarted.
jsonPath: .status.restartCount
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
conversion:
strategy: None
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, let's understand the repository structure and find context
find . -name "*.yaml" -path "*/crds/*" -o -name "*DataVolume*" | head -20

Repository: codeready-toolchain/toolchain-e2e

Length of output: 446


🏁 Script executed:

# Check if this file has any header comments or documentation
head -50 deploy/crds/cdi.kubevirt.io_datavolumes.yaml

Repository: codeready-toolchain/toolchain-e2e

Length of output: 1828


🏁 Script executed:

# Look for other CRD files to compare documentation patterns
find . -path "*/deploy/crds/*" -name "*.yaml" | head -10

Repository: codeready-toolchain/toolchain-e2e

Length of output: 446


🏁 Script executed:

# Check git history or other references to understand the purpose
git log --oneline --all deploy/crds/cdi.kubevirt.io_datavolumes.yaml 2>/dev/null | head -5

Repository: codeready-toolchain/toolchain-e2e

Length of output: 131


🏁 Script executed:

# Search for any references to this CRD in the codebase
rg "cdi.kubevirt.io" -l | head -10

Repository: codeready-toolchain/toolchain-e2e

Length of output: 162


🏁 Script executed:

# Check if other CRD files have documentation comments
for file in ./deploy/crds/*.yaml; do
  echo "=== $(basename $file) ==="
  head -5 "$file"
done

Repository: codeready-toolchain/toolchain-e2e

Length of output: 1228


🏁 Script executed:

# Check how the DataVolume CRD is used in the e2e tests
cat test/e2e/parallel/user_workloads_test.go | head -100

Repository: codeready-toolchain/toolchain-e2e

Length of output: 4894


🏁 Script executed:

# Search for any documentation or README files explaining these CRDs
find . -name "README*" -o -name "DEPLOY*" | xargs grep -l "crd\|CRD" 2>/dev/null

Repository: codeready-toolchain/toolchain-e2e

Length of output: 116


🏁 Script executed:

# Check the CRDs README
cat ./deploy/crds/README.adoc

Repository: codeready-toolchain/toolchain-e2e

Length of output: 449


🏁 Script executed:

# Check the main README for any CRD documentation
cat ./README.adoc | grep -A 10 -i "crd\|datavolume"

Repository: codeready-toolchain/toolchain-e2e

Length of output: 1965


🏁 Script executed:

# Look for DataVolume usage in the test file
grep -n "DataVolume\|cdi\|datavolume" test/e2e/parallel/user_workloads_test.go

Repository: codeready-toolchain/toolchain-e2e

Length of output: 1154


🏁 Script executed:

# Check if there's any YAML schema validation or generation notes
find . -name "*.go" -o -name "*.sh" | xargs grep -l "datavolume\|cdi.kubevirt" 2>/dev/null | head -10

Repository: codeready-toolchain/toolchain-e2e

Length of output: 119


🏁 Script executed:

# Check the complete DataVolume creation function to understand it better
sed -n '399,420p' test/e2e/parallel/user_workloads_test.go

Repository: codeready-toolchain/toolchain-e2e

Length of output: 1207


🏁 Script executed:

# Check how CDI DataVolume is defined in the test
sed -n '455,475p' test/e2e/parallel/user_workloads_test.go

Repository: codeready-toolchain/toolchain-e2e

Length of output: 766


🏁 Script executed:

# Verify if the CRD schema in the file matches the CDI project by checking key fields
rg "preallocation|checkpoints|contentType|sourceRef" deploy/crds/cdi.kubevirt.io_datavolumes.yaml | head -10

Repository: codeready-toolchain/toolchain-e2e

Length of output: 184


Add documentation comment indicating the CRD source.

The DataVolume CRD schema is correct and comprehensive. However, following the pattern documented in deploy/crds/README.adoc for tracking CRD sources, add a comment at the top of this file indicating the source (kubevirt/containerized-data-importer project) and noting its use in e2e testing. This aligns with how other CRDs in the directory document their origins.

🤖 Prompt for AI Agents
In @deploy/crds/cdi.kubevirt.io_datavolumes.yaml around lines 1 - 659, The CRD
file for DataVolume is missing a top-of-file documentation comment indicating
its upstream source and purpose; add a brief comment at the very top of
deploy/crds/cdi.kubevirt.io_datavolumes.yaml stating that the CRD was sourced
from the kubevirt/containerized-data-importer project and that it is included
here for e2e testing (follow the style used in other CRDs in the directory), so
reviewers can quickly identify origin and intent for the DataVolume CRD.

@openshift-ci
Copy link

openshift-ci bot commented Jan 8, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MatousJobanek, mfrancisc

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:
  • OWNERS [MatousJobanek,mfrancisc]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 9, 2026

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants