containerized-data-importer/tests
Arnon Gilboa 221469d062
Add PVC spec mutating webhook rendering based on StorageProfiles (#2813)
* Add PVC mutating webhook using StorageProfiles

The webhook mutates the PVC Spec based on the available StorageProfiles,
so for example you can create PVC without accessModes and it will be
auto-completed.

To use this feature, enable the `WebhookPvcRendering` feature gate.

For any PVC you want to use StorageProfile, label it with:
    cdi.kubevirt.io/useStorageProfile: "true"

If you want to use volumeMode preferred by CDI according to
StorageProfiles, set it to FromStorageProfile. Otherwise if not
explicitly set to Block, it will be Filesystem by k8s default.

E.g.:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-test
  labels:
    cdi.kubevirt.io/useStorageProfile: "true"
spec:
  storageClassName: rook-ceph-block
  volumeMode: FromStorageProfile
  resources:
    requests:
      storage: 1Mi

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>

* Move webhook create/delete to callback

plus some CR fixes and cleanups

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>

* Move webhook CR creation to sit with callbacks

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>

* Update existing webhook if modified

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>

* Eliminate unnecessary CR update

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>

---------

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
2024-02-12 15:26:28 +01:00
..
framework update k8s & related libraries to 1.28 (#3078) 2024-01-23 17:52:05 +01:00
images Google Cloud Storage Import Support (#2615) 2023-03-22 16:49:29 +00:00
manifests Add new Prometheus alerts and label existing alerts (#2998) 2023-12-19 12:29:08 +01:00
reporter Refactor e2e kubernetes reporter (#3037) 2023-12-22 14:44:39 +01:00
utils update k8s & related libraries to 1.28 (#3078) 2024-01-23 17:52:05 +01:00
adopt-volume_test.go Feature Gate and annotation for PVCs to be "adopted" by DataVolumes (#3029) 2024-01-17 19:53:59 +01:00
api_validation_test.go Adjust functest suite for running an allowed set of tests in parallel (#2980) 2023-12-13 01:27:48 +01:00
apiserver_test.go Adjust functest suite for running an allowed set of tests in parallel (#2980) 2023-12-13 01:27:48 +01:00
badserver_test.go Check content-type in importer to warn against unexpected kubevirt imports (#2909) 2023-11-09 13:37:35 +01:00
basic_sanity_test.go Adjust functest suite for running an allowed set of tests in parallel (#2980) 2023-12-13 01:27:48 +01:00
BUILD.bazel Add PVC spec mutating webhook rendering based on StorageProfiles (#2813) 2024-02-12 15:26:28 +01:00
cdiconfig_test.go Adjust functest suite for running an allowed set of tests in parallel (#2980) 2023-12-13 01:27:48 +01:00
certrotation_test.go Adjust functest suite for running an allowed set of tests in parallel (#2980) 2023-12-13 01:27:48 +01:00
clone-populator_test.go Add PVC spec mutating webhook rendering based on StorageProfiles (#2813) 2024-02-12 15:26:28 +01:00
cloner_test.go Allow ReadWriteOncePod DVs (#3093) 2024-02-01 22:25:43 +01:00
csiclone_test.go Adjust functest suite for running an allowed set of tests in parallel (#2980) 2023-12-13 01:27:48 +01:00
dataimportcron_test.go Fix DataImportCron PVC GC race and test flakiness (#3057) 2024-01-12 02:54:40 +01:00
datasource_test.go Update to ginkgo v2 (#2788) 2023-07-26 02:35:55 +02:00
datavolume_test.go Add PVC spec mutating webhook rendering based on StorageProfiles (#2813) 2024-02-12 15:26:28 +01:00
explain_test.go Adjust functest suite for running an allowed set of tests in parallel (#2980) 2023-12-13 01:27:48 +01:00
external_population_test.go Allow ReadWriteOncePod DVs (#3093) 2024-02-01 22:25:43 +01:00
imageio-inventory.go enable ginkgolinter and fix findings (#2703) 2023-05-04 13:07:36 +02:00
import_proxy_test.go Adjust functest suite for running an allowed set of tests in parallel (#2980) 2023-12-13 01:27:48 +01:00
import_test.go Add PVC spec mutating webhook rendering based on StorageProfiles (#2813) 2024-02-12 15:26:28 +01:00
local_volume_test.go Adjust functest suite for running an allowed set of tests in parallel (#2980) 2023-12-13 01:27:48 +01:00
monitoring_test.go Fix flakiness in waitForStorageProfileMetricInit (#3038) 2023-12-25 11:12:41 +01:00
operator_test.go Introduce customizeComponents option (#3070) 2024-01-28 20:57:39 +01:00
rbac_test.go Grant ns admin missing create RBAC for various CDI resources (#3030) 2023-12-13 16:33:51 +01:00
smartclone_test.go Adjust functest suite for running an allowed set of tests in parallel (#2980) 2023-12-13 01:27:48 +01:00
static-volume_test.go Update to ginkgo v2 (#2788) 2023-07-26 02:35:55 +02:00
tests_suite_test.go Refactor e2e kubernetes reporter (#3037) 2023-12-22 14:44:39 +01:00
transfer_test.go Adjust functest suite for running an allowed set of tests in parallel (#2980) 2023-12-13 01:27:48 +01:00
transport_test.go Adjust functest suite for running an allowed set of tests in parallel (#2980) 2023-12-13 01:27:48 +01:00
upgrade_test.go Adjust functest suite for running an allowed set of tests in parallel (#2980) 2023-12-13 01:27:48 +01:00
upload_test.go Feature Gate and annotation for PVCs to be "adopted" by DataVolumes (#3029) 2024-01-17 19:53:59 +01:00
webhook_test.go Update to ginkgo v2 (#2788) 2023-07-26 02:35:55 +02:00