containerized-data-importer/pkg/controller
alromeros db59dcec87
Fix race condition in upload-controller to keep PVC annotations after a clone error (#2363)
* Modify upload-controller to keep the annotations of a PVC if a pod fails in another controller

When a pod fails, some annotations (running condition, pod phase...) are updated in the affected PVC to let other controllers know.

However, due to a lack of synchronization between some controllers, a race condition could happen where, if a pod succeeds just after a pod fails in a different controller, the annotations set in the error handling would just be updated inapropiately.

This commit modifies the upload-controller to check for clone failures before updating annotations.

Signed-off-by: Alvaro Romero <alromero@redhat.com>

* Add unit tests to updateUploadAnnotations

Signed-off-by: Alvaro Romero <alromero@redhat.com>

* Update functional tests in cloner_test to check for conditions and annotations after a pod fails

Signed-off-by: Alvaro Romero <alromero@redhat.com>

* Improve error handling in source-clone pod to avoid overwritting the DV running condition

Signed-off-by: Alvaro Romero <alromero@redhat.com>
2022-08-03 14:50:27 +02:00
..
transfer Only list Ingresses/Routes in CDI namespace instead of cluster level (#2371) 2022-08-01 22:12:47 +02:00
BUILD.bazel Allow configuring TLS profiles for our externally facing components (#2332) 2022-07-10 19:13:50 +02:00
clone-controller_test.go Clone fs to block fails on size validation (#2299) 2022-06-27 15:02:54 +02:00
clone-controller.go Only list Ingresses/Routes in CDI namespace instead of cluster level (#2371) 2022-08-01 22:12:47 +02:00
config-controller_test.go Only list Ingresses/Routes in CDI namespace instead of cluster level (#2371) 2022-08-01 22:12:47 +02:00
config-controller.go Only list Ingresses/Routes in CDI namespace instead of cluster level (#2371) 2022-08-01 22:12:47 +02:00
controller_suite_test.go Stop Using Deprecated Packages (#1548) 2020-12-24 07:08:50 +01:00
dataimportcron-conditions.go Get rid of DataImportCron finalizer (#2144) 2022-02-12 05:56:08 +01:00
dataimportcron-controller_test.go Update DataImportCron CronJob when needed (#2316) 2022-06-11 01:38:19 +03:00
dataimportcron-controller.go Only list Ingresses/Routes in CDI namespace instead of cluster level (#2371) 2022-08-01 22:12:47 +02:00
datasource-controller_test.go Add DataSource controller to update the Ready condition (#2085) 2022-01-06 21:06:23 +01:00
datasource-controller.go Only list Ingresses/Routes in CDI namespace instead of cluster level (#2371) 2022-08-01 22:12:47 +02:00
datavolume-conditions_test.go Emit event and update dv conditions when pvc fails to create due to quota (#2016) 2021-11-16 17:29:39 +01:00
datavolume-conditions.go Extract the clone logic from main reconcile loop (#2241) 2022-04-21 04:13:51 +02:00
datavolume-controller_test.go Improve error handling when pod creation fails (#2335) 2022-07-15 10:28:53 +02:00
datavolume-controller.go Fix race condition in upload-controller to keep PVC annotations after a clone error (#2363) 2022-08-03 14:50:27 +02:00
import-controller_test.go Create imageio container during CDI build. (#2156) 2022-02-18 00:36:56 +01:00
import-controller.go Improve error handling when pod creation fails (#2335) 2022-07-15 10:28:53 +02:00
runtime-util.go Move apis to staging, push to containerized-data-importer-api (#1997) 2021-10-28 13:40:24 +02:00
smart-clone-controller_test.go fix issue #2323: Cross namespace smart clone not cleaning up (#2333) 2022-06-28 14:19:11 +02:00
smart-clone-controller.go Only list Ingresses/Routes in CDI namespace instead of cluster level (#2371) 2022-08-01 22:12:47 +02:00
storageprofile-controller_test.go Make CDI clone strategy strings correct types (#2277) 2022-05-17 14:19:25 +02:00
storageprofile-controller.go Only list Ingresses/Routes in CDI namespace instead of cluster level (#2371) 2022-08-01 22:12:47 +02:00
upload-controller_test.go Fix race condition in upload-controller to keep PVC annotations after a clone error (#2363) 2022-08-03 14:50:27 +02:00
upload-controller.go Fix race condition in upload-controller to keep PVC annotations after a clone error (#2363) 2022-08-03 14:50:27 +02:00
util_test.go Improve error handling when pod creation fails (#2335) 2022-07-15 10:28:53 +02:00
util.go Fix race condition in upload-controller to keep PVC annotations after a clone error (#2363) 2022-08-03 14:50:27 +02:00