Commit Graph

61 Commits

Author SHA1 Message Date
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
Alexander Wels
c5f8d92d3b
Update external provider to allow for hpp and ceph storage. (#1318)
* Add support for external openshift cluster, in particular CRC.
make cluster-sync, and functional tests should all work.
Added documentation on how to enable CRC to work.

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

* Updates based on review.

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

* Changes based on review comments:
- removed registry in favor of making people use an external registry.
- added ceph for external provider.

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

* Fix review comments

Signed-off-by: Alexander Wels <awels@redhat.com>
2020-08-06 15:41:52 +02:00
Alexander Wels
c7a3610769
Update cdi-builder to use go version 1.14.6 (current latest) (#1310)
* Update cdi-builder to use go version 1.14.6 (current latest)
Fix functional test framework to work with go >= 1.13. We were not
using the ginkgo ordering correctly, and our framework would call
flag.Parse() too soon, and mess with the go testing flag parsing.
As a result we had to alter some of the variables that we use to build
urls to be functions so that when called the required information is
available.
Fixed several tests not checking for errors.
Fixed dumping code being initialized several times messing with the
order in which failures were reported.

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

* Fixed failing tests.

Signed-off-by: Alexander Wels <awels@redhat.com>
2020-07-23 23:09:44 +02:00
Bartosz Rybacki
ab48911b9b
WaitForFirstConsumer handling for DataVolumes (#1242)
* Set the WaitForFirstConsumer phase on DataVolume when storage uses the WaitForFirstConsumer binding mode and is not bound yet.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Skip PVC if not bound in import|clone|upload controllers.

This is done so the VM pod(not the cdi pod) will be the first consumer, and the PVC can be scheduled on the same location as the pod.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

fixup! Skip PVC if not bound in import|clone|upload controllers.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Update importer tests to force bind the PCV by scheduling a pod for pvc, when storage class is wffc.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Update datavolume tests to force bind the PCV by scheduling a pod for pvc, when storage class is wffc.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Update upload controller and upload tests to correctly handle force binding the PCV by scheduling a pod for pvc, when storage class is wffc.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Update clone tests to force bind the PCV by scheduling a pod for pvc when the storage class is wffc.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Update cloner multi-node tests to force bind the PCV by scheduling a pod for pvc when storage class is wffc.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Correct after automerge

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Improve/simplify tests

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Fix error in import test.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Update transport_test,operator_test.go

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Update rbac_test.go and leaderelection_test.go

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Improve Datavolume and PVC Checks for WFFC.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Handle wffc only if feature gate is open - import-controller

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* TEST for Handle wffc only if feature gate is open - import-controller - TEST

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Handle wffc only if feature gate is open - upload-controller with test

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* rename and simplify checks

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* cleanup after rebase

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* update tests after rebase

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* update tests after rebase

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* more cleanups

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Document new WFFC behavior

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Document new HonorWaitForFirstConsumer option

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* update docs according to comments

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* extract common function, cleanup - code review fixes

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* add comment for another pr - 1210, so it can have easier merge/rebase

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* typo

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Simplify getStoragebindingMode - code review comments

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Add FeatureGates interface - code review fix

Additionally pass the features gates instead of the particular feature gate value,
and let shouldReconcilePVC decide what to do with the feature gate. That way shouldReconcilePVC
contains all the logic, and the caller does not need to do additional calls to provide parameters.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Update matcher

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>
2020-07-22 16:23:44 +02:00
Michael Henriksen
9e2c79b1e0
move api groups to v1beta1 (#1232)
* move upload.cdi.kubevirt.io API group to v1beta1

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

* move core api to v1beta1

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

* fix os-3.11 cluster sync and add functional tests for alpha api

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

* change more occurences of v1alpha1

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

* updates after rebase

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2020-07-10 15:47:38 +02:00
Michael Henriksen
9efefdef49
[flaky test] verifier pods hanging around keeps cloning from working (#1261)
* verifier pods hanging around keeping cloning from working

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

* GetDiskGroup will wait for pod to actually be deleted if requested

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2020-06-26 15:08:11 +02:00
Alexander Wels
8d4d89694e
Change permissions to always be 660 for the disk image. (#1231)
Updated functional tests to check for permissions

Signed-off-by: Alexander Wels <awels@redhat.com>
2020-06-17 16:03:42 +02:00
Bartosz Rybacki
ab8b9c025e
Generating label names (#1200)
* Handle labels length correctly

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Handle service name generation correctly

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Remove not needed labels

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Store import pod name in annotation

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Enable long DV name

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Handle name with dot when creating service/label name

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Test long names on import,  upload and clone

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Store upload pod name in annotation

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Store importer scratch pvc name in annotation

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Quick fix for tests (need improvements)

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Cleanup handling scratch name

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Ensure pod/service name conflicts are handled

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Handle client errors when trying to get the import pod

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Style improvements, and other code review fixes.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Store clone source pod name in an annotation

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Correct name initialization and tests

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Do not init name if pod already exists. It is not needed.

The situation of having a pod but not name on annotation can happen after the upgrade, when we have a legacy pvc and pod already existing, but clone operation not finished. But when we already have the pod, then in the code (currently) we do not need the name from annotation.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Cleanup scratch name handling

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Use constant for max dv name in validation

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Simplify clone source pod name initialization

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>
2020-05-29 19:55:32 +02:00
Alexander Wels
1ee03ed0fe
Fixed race for block blank disks where datavolume phase was not being updated. (#1192)
Fixed test to check for error on phase detection.

Signed-off-by: Alexander Wels <awels@redhat.com>
2020-04-30 14:03:15 +02:00
Bartosz Rybacki
6d97be73d3
Add DV restarts test for upload controller (#1186)
* Add import/upload/clone functional tests for DataVolume restarts column

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Cleanup tests tests

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>
2020-04-23 21:41:10 +02:00
Alexander Wels
08ed6f2b39
Clean up client-go left overs after converting to runtime library. (#1163)
* Clean up client-go left overs after converting to runtime library.
Clean unused functions from controller utils.go
Turn util_test.go into gingko test.
Moved functions from util to proper controller if only used by that controller.

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

* Don't export reconciler variables.

Signed-off-by: Alexander Wels <awels@redhat.com>
2020-04-02 22:59:54 +02:00
Alexander Wels
f2657d5927
Set secondary GID of user on import and upload pods to be 107 (qemu) … (#1148)
* Set secondary GID of user on import and upload pods to be 107 (qemu) for kubevirt content type.

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

* Fix broken unit tests on upload.

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

* Add import and clone test.

Signed-off-by: Alexander Wels <awels@redhat.com>
2020-03-26 14:33:48 +01:00
maya-r
a3bb6d6262
Restore sparse images as the default (revert #970) (#1140)
(Leaving in some of the checks introduced in that change)

Having sparse disks works better with external storage being
monitored for low capacity. If we allocate the full size at
start, it shows up as a disk capacity alert immediately.

Another motivation to pre-allocate was that cloning would
sometimes fail for capacity reasons.
We now validate available size before cloning, so we don't
expect that problem to return.

Signed-off-by: Maya Rashish <mrashish@redhat.com>
2020-03-12 04:43:58 +01:00
kubevirt-bot
19ee764626
Added functional tests for ResourceRequirements feature. (#1076)
Added documentation for ResourceQuota.

Signed-off-by: Alexander Wels <awels@redhat.com>
2020-03-04 23:30:57 +01:00
Alexander Wels
d5dc5a03c8
Increase test timeouts to account for slower CI (#1125)
Signed-off-by: Alexander Wels <awels@redhat.com>
2020-02-26 14:08:52 +01:00
Alexander Wels
5ed55cb22c
Remove code that potentially let DV get into failed state with RestartOnFailure policy. (#1099)
Signed-off-by: Alexander Wels <awels@redhat.com>
2020-02-10 23:29:15 +01:00
Fred Rolland
fe38c5ac33 Add node selectot for VerifyPvcEmpty pod (#974)
Signed-off-by: Fred Rolland <frolland@redhat.com>
2019-09-26 10:08:53 -04:00
Alexander Wels
2884854375
falloc on resize and blank disk. (#970)
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-09-25 07:57:30 -04:00
zvikorn
7dd334121c Creating blank disk on a block device (#962)
Signed-off-by: tavni <tavni@redhat.com>
2019-09-18 19:06:02 -04:00
Alexander Wels
6f350eb0a7
Use right lane k8s-1.15.1, and verify that --enable-ceph is set. (#959)
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-09-18 07:21:15 -04:00
Alexander Wels
6704acdf02
Fix transport tests to work with ceph file system. (#953)
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-09-10 00:27:05 -04:00
Alexander Wels
fe9df1803b
Properly size disks based on the PVC request size. (#940)
1G = 1000000000
1Gi = 1073741824

Signed-off-by: Alexander Wels <awels@redhat.com>
2019-08-27 08:56:04 -04:00
Michael Henriksen
019c843586 make clone pods use selinux type spc_t instead of privileged (#875)
* make clone pods use selinux type spc_t instead of privileged

* fix block mode related tests
2019-07-08 13:58:42 -04:00
Alexander Wels
dc4d22dc5d
Allow specifying block storage class. (#815)
Fix node selection functional test

Signed-off-by: Alexander Wels <awels@redhat.com>
2019-06-28 08:22:56 -04:00
Alexander Wels
6c86b0dbd6 Remove a flaky part of the test that didn't add value.
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-06-07 08:45:48 -04:00
Daniel Erez
0a90bfb4d0 datavolume_test: tar archive import
Added positive and negative functional tests for
importing tar archive files.

Change-Id: I584ab0e2ae4572a6300cb531ce5f9c02c4449d2b
Signed-off-by: Daniel Erez <derez@redhat.com>
Signed-off-by: Fred Rolland <frolland@redhat.com>
Co-authored-by: Fred Rolland <frolland@redhat.com>
2019-06-06 11:30:03 +03:00
Fred Rolland
0088b2a0e3 Add Polarion ID to import archive test
Signed-off-by: Daniel Erez <derez@redhat.com>
Signed-off-by: Fred Rolland <frolland@redhat.com>
Co-authored-by: Daniel Erez <derez@redhat.com>
2019-05-29 16:01:11 +03:00
Alexander Wels
7a53e3b34b Fix archive test to properly use cdi namespace variable.
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-05-15 10:20:48 -04:00
Alexander Wels
af31abe41b
Merge pull request #777 from awels/remove_tar_from_reader
Remove tar from the readers
2019-05-15 07:52:44 -04:00
Alexander Wels
f40c16b25b Randomize cdi namespace in tests.
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-05-14 10:55:42 -04:00
Alexander Wels
c30f3975d2 Remove tar from the readers
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-05-03 08:37:45 -04:00
Alexander Wels
05b6a21736 Fix issues with size header in cloning something reading beginning of data.
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-04-26 19:47:03 -04:00
tavni
e6665945bc Adding support to clone disk image from one Block PV to another
Signed-off-by: tavni <tavni@redhat.com>
2019-04-15 15:33:52 +03:00
Michael Henriksen
c54155d189 import/upload should not look for pods when they may not exist 2019-03-29 10:26:32 -04:00
Alexander Wels
77e4d7b99d
Update import_test.go 2019-03-28 11:37:38 -04:00
tavni
d4c7b0be54 Adding support to import disk image into Block PV
Signed-off-by: tavni <tavni@redhat.com>
2019-03-28 11:43:56 +02:00
Alexander Wels
0a32c5be1c Test prometheus endpoint existance.
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-02-28 11:42:13 -05:00
j-griffith
30c0e1b814 Delete importer pod on pvc delete request
Related to issue #525, we have a similar situation when using PVCs
without DataVolumes.  The user requests a PVC with CDI Importer
annotations, if the Importer POD is in a fail/retry loop and the user
requests deletion of the PVC the PVC will be stuck in terminating
waiting for the user to forcibly delete the running Import POD.

This PR adds a check for PVC delete in the import controller and
will delete the POD explicitly if it sees a PVC delete request.  This
will also be picked up for Import DataVolumes, so we can remove the
extra checks that were previously added in the DV controller.

fixes #649
fixes #525
2019-02-20 13:43:09 -07:00
Nelly Credi
0c6e1ff6ae updated to [attr1][attr2][attr3] struct 2019-01-10 17:09:51 +02:00
Nelly Credi
0149a300c7 Add test attributes
Added rfe id, test id, criticality etc

Based on issue
https://github.com/kubevirt/containerized-data-importer/issues/359
2019-01-10 17:05:57 +02:00
Michael Henriksen
b135463747 operator scaffolding 2019-01-08 16:03:21 -05:00
tavni
c245fe2ae6 Adding DataVolume support for unpacking imported archive
Signed-off-by: tavni <tavni@redhat.com>
2019-01-08 15:10:02 +02:00
Alexander Wels
8b27e695f0 Fix some functional test issues running locally.
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-01-03 10:34:56 -05:00
tavni
f4bb5e531e Adding more functional tests for blank-raw-image, PV allocation on specific
node and upload disk image features.

Signed-off-by: tavni <tavni@redhat.com>
2018-12-20 13:32:54 +02:00
Alexander Wels
928ed8621b
Merge branch 'master' into fix_misspell 2018-12-06 11:32:42 -05:00
Michael Henriksen
2b6b39361a was incorrectly getting available free space on volume 2018-12-05 11:28:04 -05:00
Alexander Wels
2764d4feec Fix go report card issues.
Signed-off-by: Alexander Wels <awels@redhat.com>
2018-11-30 15:42:02 -05:00
tavni
aebc2b3e87 Add ability to create empty disk images #497
Signed-off-by: tavni <tavni@redhat.com>
2018-11-27 16:15:44 +02:00
j-griffith
cd88a3d8b7 Check orphaned DataVolume PVCs for PODs
This change adds an extra check to deleted Data Volume PVCs and makes
sure that we explicitly delete any associated POD objects that they
owned regardless of their phase.

GH Issue #525
2018-11-17 09:46:26 -07:00
Alexander Wels
995ebf39e7 Increase e2e test timeouts.
Signed-off-by: Alexander Wels <awels@redhat.com>
2018-11-02 11:31:45 -04:00