* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
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>
* [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>
* 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>
* 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>
- 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>
- 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>
* 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>