Commit Graph

41 Commits

Author SHA1 Message Date
Alex Kalenyuk
b2bd873d77
update k8s & related libraries to 1.31 (#3625)
* Bump k8s/OpenShift/ctrl-runtime & make deps-update

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

* operator: fix prometheus API bool->*bool change

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

* certrotation: pass signer ns/name according to API change

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

* certrotation: adapt by passing clock through API

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

* certrotation: create empty secret with type tls

Brace yourself for a rollercoaster:
https://github.com/openshift/library-go/blob/release-4.18/pkg/operator/resource/resourceapply/core.go#L452
this path is no longer used since recent library-go.

We should be okay since the versions upgrading to this CDI
have a secret that was converted to the TLS type

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

* certrotation: adapt to unit tests failing on secret create

context https://github.com/openshift/library-go/pull/1772

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

* Revert "handle "already exists" when certrotation creates secret"

This reverts commit 9acaa19d37.

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

---------

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
2025-02-24 20:24:44 +01:00
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
Alex Kalenyuk
31d12e426e
update k8s & related libraries to 1.28 (#3078)
* Bump k8s/OpenShift/ctrl-runtime/lifecycle-sdk & make deps-update

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

* Operator: adapt for dependency bump

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

* Controller: adapt watch calls for dependency bump

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

* Controller: adapt to ctrl-runtime's cache API changes

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

* Operator: fix unit tests by deleting resources properly in fake client

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

* Controller: fix unit tests by deleting resources properly in fake client

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

* Controller: adapt to fake client honoring status subresource

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

* Fix codegen script & make generate

There are some issues in the new script, so we
will still use the deprecated one.
More context in f4d1a5431b

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

* Functests: Adapt to NamespacedName now implementing MarshalLog

ns/name -> {"name":"name","namespace":"ns"}

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

* Functests & API server: address deprecation of wait.PollImmediate

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

---------

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
2024-01-23 17:52:05 +01:00
Aviv Litman
3bb70209d0
Refactor monitoring code (#3009)
* refactor monitoring

Signed-off-by: avlitman <alitman@redhat.com>

* Upgrade pointer to pnt

Signed-off-by: avlitman <alitman@redhat.com>

* fix controller base and ready gague

Signed-off-by: avlitman <alitman@redhat.com>

---------

Signed-off-by: avlitman <alitman@redhat.com>
2024-01-02 09:17:18 +01:00
akalenyu
ab1571579e
Bump controller runtime to avoid mistakenly defaulting to wrong mapper (#2896)
* Bump controller runtime to avoid mistakenly defaulting to wrong mapper

Today, controller runtime mistakenly ignores the inherited Manager default
dynamic mapper and uses a discovery mapper instead:
https://github.com/kubernetes-sigs/controller-runtime/pull/2491
This means that if some CRD was not available on the cdi-controller startup,
Even if it got installed after, we would still get IsNoMatch when trying to access it.

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

* Bump k8s deps to 1.26.10

Aligned with https://github.com/kubernetes-sigs/controller-runtime/pull/2559

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

---------

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
2023-11-09 21:39:29 +01:00
Alexander Wels
bd6335259d
Update golang to 1.20.7 (#2884)
* Update golang to 1.20.7

Use the cdi builder which is configured with golang 1.20.7
Updated some libraries to the latest version, specifically
excluding k8s and runtime-controller due to issues that need
to be resolved outside of this commit.

Signed-off-by: Alexander Wels <awels@redhat.com>

* Fix linter issue
Fix generate verify issue

Signed-off-by: Alexander Wels <awels@redhat.com>

* Ran make deps-update

Signed-off-by: Alexander Wels <awels@redhat.com>

* Fix cdi verify go mod

Signed-off-by: Alexander Wels <awels@redhat.com>

---------

Signed-off-by: Alexander Wels <awels@redhat.com>
2023-09-03 18:23:35 +02:00
akalenyu
edd6940d8c
bump k8s.io/client-go dep for discovery client fixes (#2855)
* bump k8s.io/client-go dep for discovery client fixes

k8s.io/client-go [v0.26.0, v0.26.3) was impacted by a regression in discovery client behavior
https://github.com/kubernetes/kubernetes/issues/118361#issuecomment-1579198407 for details
We are probably not hitting this due to not testing 1.27 upstream yet,
or don't have the custom metric endpoints that send these nils in the response.
(Reproduces on OpenShift ECs for example)

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

* make generate

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

---------

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
2023-08-23 03:08:31 +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
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
alromeros
2e9a9257f9
Add support for volume populators (#2482)
* Add support for volume populators in CDI

This commit enables the use of volume populators in CDI, so datavolume-owned PVCs can be populated using custom logic.

Volume populators are CRDs used to populate volumes externally, independently of CDI. These CRDs can now be specified using the new DataSourceRef API field in the DataVolume spec.

When a DataVolume is created with a populated DataSourceRef field, the datavolume-controller creates the corresponding PVC accordingly but skips all the population-related steps. Once the PVC is bound, the DV phase changes to succeeded.

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

* Modify CDI test infrastructure to support testing of external populators

This commit introduces several changes to CDI ci to support the testing of DataVolumes with external populators:
* A sample volume populator is now deployed in the test infrastructure, in a similar way as bad-webserver or test-proxy. This populator will be used in functional tests from now on.
* A new test file with external population tests has been introduced in the tests directory

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

* Update dependencies to include lib-volume-populator library

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

* Add functional tests for proper coverage of external population of DataVolumes

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

* Minor fixes on external-population logic for DataVolumes:
* Added comments for exported structs
* Removed non-inclusive language
* Improved error messages in webhooks
* Fixed logic on datavolume-controller

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

* Improve DataVolume external-population logic when using the old 'DataSource' API

This commit introduces several changes into the datavolume external-population controller to improve its behavior when using the DataSource field.

It also introduces minor fixes on the generic populator logic.

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

* Add unit tests for external-population controller and DV admission

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

Signed-off-by: Alvaro Romero <alromero@redhat.com>
2023-01-17 21:56:15 +01:00
akalenyu
1e82636810
Run make deps update after 2265 (#2280)
Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
2022-05-17 17:39:26 +02:00
Roman Mohr
b9c0684469
Separate sdk api (#2208)
* Introduce controller-runtime-sdk api package

Split controller-runtime-sdk into the base package and
controller-runtime-sdk/api.

Signed-off-by: Roman Mohr <rmohr@redhat.com>

* go mod vendor

Signed-off-by: Roman Mohr <rmohr@redhat.com>

* Update code references

Signed-off-by: Roman Mohr <rmohr@redhat.com>
2022-03-31 21:31:18 +02:00
Michael Henriksen
97effa477a
update go.mod to 1.17 format (#2165)
Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2022-02-23 01:21:30 +01:00
Michael Henriksen
d56e0cca05
23 libs (#2077)
Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2022-01-07 16:56:25 +01:00
Matthew Arnold
00a2307426
Add go-ovirt-client for ImageIO importer. (#1963)
* Add go-ovirt-client.

Signed-off-by: Matthew Arnold <marnold@redhat.com>

* Add go-ovirt-client logging dependencies.

Signed-off-by: Matthew Arnold <marnold@redhat.com>

* Update existing go-ovirt-client dependencies.

Signed-off-by: Matthew Arnold <marnold@redhat.com>

* Use go-ovirt-client for oVirt API connections.

This is the smallest way to introduce real usage of go-ovirt-client.

Signed-off-by: Matthew Arnold <marnold@redhat.com>

* Get functional tests working with go-ovirt-client.

Test API credentials are no longer passed to the ImageIO importer a
base64, and there is now a response to the /ovirt-engine/api URL that
the go-ovirt-client uses to check for a live API.

Signed-off-by: Matthew Arnold <marnold@redhat.com>
2021-10-06 20:01:03 +02:00
Michael Henriksen
d92c2f459d
update deps and bazel (#1815)
* update deps and bazel

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

* fix apidocs and unit tests

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

* fix generate-verify

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2021-06-08 01:31:59 +02:00
akalenyu
0428dc5465
Stop using deprecated admissionregistration, apiregistration v1beta1 (#1804)
Switch admissionregistration.k8s.io/v1beta, apiregistration.k8s.io/v1beta1 to v1
as they are deprecated and will be removed from k8s-1.22.

apiextensions.k8s.io/v1beta1 was updated to v1 by https://github.com/kubevirt/containerized-data-importer/pull/1307.

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
2021-05-26 22:52:47 +02:00
Tomasz Barański
91a15c57d1
Preallocation support (#1498)
* [WIP] doc: User-facing doc for preallocation support

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* apis: CDI accepts `preallocation` option.

With this commit CDI accepts (but does handle) `preallocation` settings
for DataVolumes and in CDIConfig.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* core: Implementing preallocation

This commit implements preallocation support for import and upload.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* test: Functional tests for preallocation support

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* core: Remove "preallocation for StorageClasses" config

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* test: Removed unused function

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* test: Fix rook-ceph test failures

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* Updated dependencies
Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* core: Uss PVC annotation to pass preallocation parameters

DataVolume controller now uses a PVC annotation to pass preallocation
configuration to import and update controllers.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>
2020-12-18 16:46:16 -05:00
Michael Henriksen
75f4fd6f2f
update k8s deps to 18.6 and controller runtime to 0.6.2 (#1330)
* update k8s deps to 1.18.6 and controller runtime to 0.6.2

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

* remove building code generators from docker image.  This way the k8s ligray version only has to be updated in go.mod

Do more stuff in the bazel container.  Faster and better interop

Fix unit tests

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

* make format

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

* remove unnecessary rsync

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

* redo code generator dep management

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

* builder uses go modules

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2020-08-07 14:09:52 +02:00
Michael Henriksen
1b5c5fe0a9
use kubernetes openapi generator (#1222)
Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2020-06-03 22:47:35 +02:00
Michael Henriksen
bd4c4c950b
cert rotation (#1091)
* initial cert rotation controller

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

* fix typo

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2020-02-03 23:36:58 +01:00
Michael Henriksen
99f8af5b86 k8s client upgrade to 1.16 (#1079)
* initial client upgrade to 1.16

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

* fix Route detection in OpenShift

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2020-01-14 13:43:17 +01:00
Alexander Wels
a67c64c338
initial bazelification of CDI (#986)
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-10-15 15:55:44 -04:00
Abdul Hameed
61d71d2e1c added CRD open API schema validation and unit tests (#927)
Signed-off-by: Abdul Hameed <ahameed@redhat.com>
2019-10-15 11:18:50 -04:00
Alexander Wels
5acc1df798
Move dependency management to go modules instead of glide. (#989)
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-10-09 15:02:17 -04:00
Alexander Wels
45eecea14e
Added conditions to match the HCO requirements. (#910)
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-08-28 18:36:44 -04:00
Artyom Lukianov
32a14495ae Update all vendor k8s components to 1.13.4 2019-05-16 09:38:37 +03:00
Nelly Credi
f9e8fec9ff Update qe-tools to v0.1.3
and refresh vendor
2019-05-13 20:23:14 +03:00
Y.Horie
db50798c38 update vendor excuting glide 2019-03-06 23:23:44 +09:00
Michael Henriksen
277193f18a operator unit tests 2019-01-29 12:50:27 -05:00
Michael Henriksen
051ecd417e update securitycontext for openshift 2019-01-17 09:20:32 -05:00
Michael Henriksen
d02ed1d741 generate cdi-controller.yaml from resources defined in code 2019-01-11 10:15:03 -05:00
Michael Henriksen
7170ba40f6 update kubernetes client/tools to 1.12.4 and controller runtime to 0.1.9 2019-01-08 16:10:30 -05:00
Alexander Wels
3c405669e5 Update vender dependencies.
Signed-off-by: Alexander Wels <awels@redhat.com>
2018-11-28 10:05:47 -05:00
Michael Henriksen
6e88eea42a update kubernetes libraries 1.11.2 (same as KubeVirt) 2018-10-19 20:12:41 -04:00
David Vossel
9666be0d48 Add kube-aggregator and restful go dependencies to glide
Signed-off-by: David Vossel <davidvossel@gmail.com>
2018-09-19 12:29:39 -04:00
Alexander Wels
ea15dd41f5 Add regular PVC creation e2e test.
- Added e2e test to see if regular PVC doesn't get populated.
- Added PVC utilities, for both framework and stand alone
- Added exec utility functions to execute commands against running
  Pods.

Signed-off-by: Alexander Wels <awels@redhat.com>
2018-08-22 14:10:49 -04:00
Alexander Wels
4ca250a167 funtional test framework (serial runs only)
- Added functional test framework similar to kubevirt one.
- Added basic sanity test to demonstrate framework.
- Updated some vendor packages.

Signed-off-by: Alexander Wels <awels@redhat.com>
2018-08-08 13:08:26 -04:00
David Vossel
fdb1b27467 Single Queue and Expectations (#249)
* Pull in expectations code from kubevirt

Signed-off-by: David Vossel <davidvossel@gmail.com>

* add expectations to datavolume controller

Signed-off-by: David Vossel <davidvossel@gmail.com>

* Refactor importer pod to use single queue and expectations

Signed-off-by: David Vossel <davidvossel@gmail.com>

* update utils tests to use single queue

Signed-off-by: David Vossel <davidvossel@gmail.com>

* re-introduce import controller test suite

Signed-off-by: David Vossel <davidvossel@gmail.com>

* make clone controllers pass after utils refactor

Signed-off-by: David Vossel <davidvossel@gmail.com>

* Use log level constants in cdi controllers

Signed-off-by: David Vossel <davidvossel@gmail.com>

* Remove useless shadow variables in expectations pkg

Signed-off-by: David Vossel <davidvossel@gmail.com>

* required changes to get owner references working with openshift 1.10

Signed-off-by: David Vossel <davidvossel@gmail.com>

* update functional tests to work with importer controller refactor

Signed-off-by: David Vossel <davidvossel@gmail.com>

* Rename AnnImportPVC to LabelImportPvc in order to reflect its use

Signed-off-by: David Vossel <davidvossel@gmail.com>

* Add comment about expectations code

Signed-off-by: David Vossel <davidvossel@gmail.com>
2018-07-30 12:09:15 -05:00
David Vossel
cfde46d47c add pkg dependencies for crd controller 2018-06-11 21:58:15 -04:00
Jon Cope
9363dffa29 Init'd glide, Vendored in dependencies 2018-01-18 16:59:08 -06:00