containerized-data-importer/pkg/controller/populators
Felix Matouschek ca8085a25c
feat(import): Set PVC labels derived from env vars on containerdisks (#3103)
* feat(cdi-containerimage-server): Add info endpoint

The info endpoint returns a ServerInfo object containing all
environment variables of the server serialized to json. This allows the
extraction of env vars from a containerdisk when using pullMethod node.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>

* feat(importer): Add conversion of env vars to label

This adds the conversion of env vars containing KUBEVIRT_IO_ to a label
key/value pair.

Example: TEST_KUBEVIRT_IO_TEST=testvalue becomes test.kubevirt.io/test:
testvalue.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>

* feat(importer): Extract labels from registry datasource

This allows the registry-datasource to return a termination message with
labels extracted from the env vars of a source containerdisk when using
pullMethod pod.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>

* feat(importer): Extract labels from http datasource

This allows the http-datasource to return a termination message with
labels extracted from the env vars of a source containerdisk when using
pullMethod node.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>

* feat(controller): Set PVC labels from importer termination message

With this change the import-controller is able set labels on destination
PVCs returned from the importer in its termination message.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>

* tests: Add tests for conversion of containerdisk env vars to PVC labels

This adds tests for the conversion of containerdisk env vars to PVC
labels for both pullMethods pod and node.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>

* fix: Fix race in import-populator

By running reconcileTargetPVC of populatorController on every reconcile
cycle, the import-populator controller is able to retry seting labels and
annotations on the target PVC when import-controller modified the target
PVC at the same time.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>

---------

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-03-21 23:13:16 +01:00
..
BUILD.bazel Refactor monitoring code (#3009) 2024-01-02 09:17:18 +01:00
clone-populator_test.go Refactor monitoring code (#3009) 2024-01-02 09:17:18 +01:00
clone-populator.go update k8s & related libraries to 1.28 (#3078) 2024-01-23 17:52:05 +01:00
import-populator_test.go feat(import): Set PVC labels derived from env vars on containerdisks (#3103) 2024-03-21 23:13:16 +01:00
import-populator.go feat(import): Set PVC labels derived from env vars on containerdisks (#3103) 2024-03-21 23:13:16 +01:00
populator-base.go feat(import): Set PVC labels derived from env vars on containerdisks (#3103) 2024-03-21 23:13:16 +01:00
populators_suite_test.go Update to ginkgo v2 (#2788) 2023-07-26 02:35:55 +02:00
upload-populator_test.go feat(import): Set PVC labels derived from env vars on containerdisks (#3103) 2024-03-21 23:13:16 +01:00
upload-populator.go feat(import): Set PVC labels derived from env vars on containerdisks (#3103) 2024-03-21 23:13:16 +01:00
util.go Default storage class for virtualization purposes (#2913) 2023-10-27 04:28:15 +02:00