Commit Graph

6 Commits

Author SHA1 Message Date
Michael Henriksen
5195176c16
update to k8s 1.30 libs and controller-runtime 0.18.4 (#3336)
* make deps-update

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

* ReourceRequirements -> VolumeResourceRequirements

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

* fix calls to controller.Watch()

controller-runtime changed the API!

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

* Fix errors with actual openshift/library-go lib

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

* make all works now and everything compiles

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

* fix "make update-codegen" because generate_groups.sh deprecated

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

* run "make generate"

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

* fix transfer unittest because of change to controller-runtime

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

---------

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2024-07-14 20:12:50 +02:00
Benny Zlotnik
f8484ba343
forklift: rename API group (#3295)
* forklift: rename API group

To avoid collisions with forklift's CRDs

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: rename to forklift.cdi.kubevirt.io

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

---------

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
2024-06-05 00:05:35 +02:00
Arnon Gilboa
d365661e30
Fix progress metric registration and parsing (#3292)
* Fix progress metric registration and parsing

Use default metric registration. We shouldn't use the controller-runtime
registration as we have no controller here and it will not register the
metric correctly.

Fix the metric parsing to match its new name. Otherwise the DV progress
will not be updated until its 100%.

Regression introduced in #3254

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

* Add kubevirt_cdi_import_progress_total metric

Use it in the importer instead of kubevirt_cdi_clone_progress_total and
fix metric parsing accordingly.

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

* Move ProgressFromClaim to host-clone

Nobody else is using it.

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

* Add ProgressMetric interface

ProgressReader can now work with either import or clone progress metric.
FIXME: consider removing the direct Add/Get and use only via interface.

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

* Refactor ProgressMetric interface

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

* Refactor progress parsing

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

* Refer metric names from the metrics package

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

---------

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
2024-06-03 13:25:37 +02:00
Benny Zlotnik
71493fedc2
forklift: fix race between prime pvc and pod removal (#3280)
* forklift: fix race between prime pvc and pod removal

Because there is time until deletionTimestamp is set on the PVC prime,
and since the populator pod is deleted first we might reconcile again
when the PVC is not yet marked for deletion, causing the populator pod
to be recreated.

This change reorders the operation, to first wait until the PVC is
marked for deletion, and then delete the populator pod.

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: add tests

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

---------

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
2024-06-01 04:31:30 +02:00
Arnon Gilboa
a5cedb1555
Progress metrics refactor and rename (#3254)
* clone_progress metric refactor

The clone_progress metric is not in the monitoring package. The metric
is with incorrect name, based on the kubevirt and Prometheus metrics
naming conventions. It's not documented and not located under
/pkg/monitoring. After the code refactoring we should not have
Prometheus metrics in other places in the code, other than the
/monitoring/metrics package, and metrics should be registered using
operator-observability package.

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

* openstack_populator_progress metric refactor

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

* clone_progress metric refactor CR fixes

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

* ovirt_progress metric refactor

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

* Align progress metrics names with linter rules

Also add the metrics to the doc and json generation tools.

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

* Remove redundant ListMetrics

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

---------

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
2024-05-17 14:02:25 +02:00
Benny Zlotnik
46f0f76ed4
forklift: introduce forklift controller (#2983)
* forklift: add types for forklift populators

Introduce the OvirtVolumePopulator and OpenstackVolumePopulator types

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: introduce forklift controller

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: add CRD missing CRD suffix

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: fix tests

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: start support for mutated PVC

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: fix linter issues

and skip bound PVCs

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: update vendor and generated code

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: remove unnecessary argument

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: add ovirt-populator to cdi-importer

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: fix linter issues

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: fix contrller_test

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: regenerate swagger

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: normalize ovirt image name

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: restore OVIRT_POPULATOR_IMAGE_NAME

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: address comments

- remove accidental copy-paste
- change type of NAD reference to string
- use NAD in the controller

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: add doc with examples for the forklift populators

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: rename secret reference

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: fix linter warning

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: update deps

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: fix linter issues

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: use ginkgo for openstack populator test

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* Roll back nginx from 1.24.0 to 1.22.1 to avoid segfaults when pulling…
… images with tls

Possibly a bug, there were some segfault fixes in 1.25.4 release:
https://nginx.org/en/CHANGES

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

* forklift: address comments

- Fix const
- Reverse conditional
- Pass context to reconcile
- Improve cross namespace check
- Add populator pod watcher

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: address comments

- Drop unnecessary comments
- Add dataSourceRef check
- Add node to spec

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: add restartCount annotation

- fix race condition leaving Running phase in annotation
- fix metrics UT

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: address comments

- Change optional fields to a pointer
- Fix Pod watch
- Add NotFound check to avoid an extra reconile

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

* forklift: regenerate

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

---------

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
Co-authored-by: Alex Kalenyuk <akalenyu@redhat.com>
2024-05-14 21:38:22 +02:00