Commit Graph

13 Commits

Author SHA1 Message Date
Arnon Gilboa
107f0b0c04
Remove embedded reconcile.Reconciler (#2698)
Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
2023-04-24 20:37:00 +02:00
Michael Henriksen
8cb11f53d9
update k8s libs to 1.26. (#2687)
* update k8s libs to 1.26.

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>

* remove some checks in log messages, they're redundant, and the format has changed

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>

* use 1.26 lib function `CheckVolumeModeMismatches` and `CheckAccessModes`

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>

---------

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2023-04-18 19:30:40 +01:00
Nahshon Unna Tsameret
48166bdc8d
Enable additional linters to golangci-lint configuration (#2691)
* enable the typecheck linter in golangci-lint

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>

* enable the staticcheck linter and fix findings

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>

* golangci-lint: enable ineffassign and fix finding

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>

---------

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>
2023-04-17 13:30:28 +01:00
Marcelo Feitoza Parisi
c7467cc5fd
Google Cloud Storage Import Support (#2615)
* Google Cloud Storage Importer

This is a Google Cloud Storage importer for CDI

Signed-off-by: Marcelo Parisi <marcelo@feitoza.com.br>

* Fix auto-generated swagger and openapi

Signed-off-by: Marcelo Parisi <marcelo@feitoza.com.br>

* GCS Importer General Fixes

Signed-off-by: Marcelo Parisi <marcelo@feitoza.com.br>

* Moving back gcs-secret.txt

Moving file back to imageDir to fix unit testing.

Signed-off-by: Marcelo Parisi <marcelo@feitoza.com.br>

---------

Signed-off-by: Marcelo Parisi <marcelo@feitoza.com.br>
Co-authored-by: Marcelo Parisi <marcelo@dev-box.corp.feitoza.com.br>
2023-03-22 16:49:29 +00:00
Ido Aharon
184ee03acf
Pass DV labels to PVC (#2547)
* Pass DV labels to PVC

Signed-off-by: Ido Aharon <iaharon@redhat.com>

* Rebase and add utests

Signed-off-by: Ido Aharon <iaharon@redhat.com>

* Transferring annotations in smart clone and passing dv instead of client

Signed-off-by: Ido Aharon <iaharon@redhat.com>

* CSI clone and Cloning from snapshot source functional tests

Signed-off-by: Ido Aharon <iaharon@redhat.com>

* CSI clone and Cloning from snapshot source functional tests

Signed-off-by: Ido Aharon <iaharon@redhat.com>

* uninitialized map case fixed

Signed-off-by: Ido Aharon <iaharon@redhat.com>

---------

Signed-off-by: Ido Aharon <iaharon@redhat.com>
2023-03-17 20:57:35 +00:00
Arnon Gilboa
90dce53da9
Enable DV status subresource (#2611)
DV status can now be updated only by UpdateStatus() and no more by
Update(), so regular users cannot update status without special
permission. In addition, updating just the status would not update
the generation of the object, so we’ll have less “object has been
modified” errors in the reconcile loops.

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
2023-03-08 05:43:16 +00:00
akalenyu
f58f83feeb
Add sourceRef support for VolumeSnapshot sources (#2582)
Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
2023-03-03 16:53:55 +00:00
Arnon Gilboa
12d57d6a94
Get rid of sync/updateStatus shared state (#2590)
There should be no state shared between sync() and updateStatus().
updateStatus() should stand on it's own, and come to it's own
conclusions based on what it observes. It is okay if it is "late to the
party" and does not observe the latest changes in sync(). It will
eventually converge. This is what kubevirt does.

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
2023-02-23 22:50:41 +01:00
Michael Henriksen
496efbcafb
Annotation to check for statically provisioned PVs when creating DataVolumes (#2583)
* function should return dataVolumeSyncResult, take *dataVolumeSyncResult as a parameter

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>

* checkStaticVolume implemetation for import DataVolume

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>

* upload support for checkStaticVolume

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>

* checkStaticVolume for clone datavolumes

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>

* checkStaticVolume for snapshot clone

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>

* checkStaticVolume for external populator source

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>

* tignten up static volume check

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>

* expand functional test to compare creation timestamps

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>

* updates from code review mostly add md5 verification to test and refacto common index creation

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>

* webhook changes, allow clone source DataVolumes (with special annotations)
even if source does not exist or user has no permission

BUT no token is added so this is really just for the static/prepopulate cases

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>

---------

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2023-02-22 23:40:48 +01:00
akalenyu
e54cc283ca
Clone from VolumeSnapshot source (#2522)
* API for VolumeSnapshot clone source

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>

* Refactor doCrossNamespaceClone to get rid of some source PVC assumptions

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>

* Refactor isCrossNamespaceClone to get rid of some some source PVC assumptions

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>

* Clone from VolumeSnapshot source controller

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>

* Func tests for cloning from volumesnapshot source

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>

* Extend cross ns clone token mechanism for VolumeSnapshot cloning

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>

* Validate source volumesnapshot on create

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>

---------

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
2023-02-03 04:44:13 +01:00
akalenyu
e57696e463
Grab target PVC early on to avoid false status updates (#2559)
Now that we update status in the end of a loop regardless of err,
it is important that we have the PVC in place for that.
Otherwise, if we fail at cleanup/prepare, syncRes.pvc is nil,
and we get false status updates like the following:
```bash
NAMESPACE   NAME               PHASE                             PROGRESS   RESTARTS
default     cloned-target-dv   Succeeded                         N/A                   23s
default     cloned-target-dv   Pending                           N/A                   23s
default     cloned-target-dv   Pending                           N/A                   23s
default     cloned-target-dv   Pending                           N/A                   23s
NAMESPACE   NAME                 STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS      AGE
golden-ns   golden-snap-source   Bound    pvc-63ed1368-9f84-44ce-8b4b-7e9e3c4574f4   8Gi        RWO            rook-ceph-block   5m59s
(Target got deleted)
```
This results in a nasty bug where the target PVC simply disappears.

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
2023-01-31 21:06:04 +01:00
akalenyu
8f89386557
Don't keep going after cleanup finished successfully (#2556)
Right now if cleanup finishes succesfully we just keep going
on in the reconcile loop, even though deletion timestamp is set

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
2023-01-29 14:11:13 +01:00
akalenyu
3a4af3eff0
Introduce base clone controller and adjust PVC clone controller accordingly (#2544)
We are introducing cloning from snapshot soon as a new controller,
as part of those efforts, it was identified to be beneficial to have this split.

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
2023-01-18 19:34:59 +01:00