Commit Graph

40 Commits

Author SHA1 Message Date
Michael Henriksen
8b9ce68262
enable webhooks for alpha resources (#1321)
* enable webhooks for alpha resources

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

* clean up transport test

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

* update alpha api test, webhook error message was changed

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2020-08-01 16:09:50 +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
Tomasz Barański
57717261c2
[test] Import from registry using credentials - tier 1 test (#1281)
Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>
2020-07-08 02:11:37 +02: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
Alexander Wels
a4c51ed8b4
Move base images to fedora 31. (#1119)
Signed-off-by: Alexander Wels <awels@redhat.com>
2020-03-07 17:07:12 +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
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
5740cee5fd fix host:port not allowed in insecure registry configmap 2019-05-29 17:05:55 -04:00
Alexander Wels
fc5edd6842 Increase verify pod timeout to 90 seconds.
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-05-28 13:42:31 -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
Michael Henriksen
c54155d189 import/upload should not look for pods when they may not exist 2019-03-29 10:26:32 -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
Michael Henriksen
08ce3ad394 https cert configuration 2019-03-05 18:15:33 -05:00
Michael Henriksen
3892a7310d add configmap for insecure regestries 2019-02-25 20:12:56 -05:00
Michael Henriksen
717ceaa919 add ability for user to specify certs for import from registry 2019-02-18 09:06:46 -05:00
tavni
bd65f90723 Do not resize iso image files
Signed-off-by: tavni <tavni@redhat.com>
2019-02-16 11:00:27 +02:00
annastopel
b9edce9ef0 Import VM disk from ContainerDisk image 2019-02-12 21:11:39 +02:00
annastopel
cb80249a7f BugFix: cdi importer fails to import from registry when run in unpriviledged container 2019-02-06 21:17:57 +02: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
246c0739a0 Update k8s and OS versions.
Signed-off-by: Alexander Wels <awels@redhat.com>
2018-12-06 10:05:30 -05:00
Daniel Erez
518a87fdfe transport_test: undo unneeded change
Undoing an uneeded changed added in commit 3c70f9501c

Change-Id: Ida5e1a27f3d52c0a86771dbc1ace71ef90c47d08
Signed-off-by: Daniel Erez <derez@redhat.com>
2018-12-01 13:41:43 +02:00
Daniel Erez
3c70f9501c transport_test: registry source func test
Added a test for registry source:
existence of the bin file in the image (i.e. /pvc/usr/bin/cdi-importer).

Change-Id: Iefd825e841a040263679d53749a6361f8bc4560d
Signed-off-by: Daniel Erez <derez@redhat.com>
2018-11-30 15:17:56 +02:00
Daniel Erez
573374b831 Import vm disk from docker registry
As a user, I want to specify a registry source to pre-populate my PV with a VM disk image.

* Using skopeo[1] cli to copy image from docker registry.
* Extracting image layers (tar files) into data folder.
* Cleaning up .wh. files and remove corresponding files.
* Supporting docker registries such as: docker hub, quay, etc.

[1] https://github.com/containers/skopeo

Change-Id: Ib4e20bb7be842ebaabeb925202402791827edfd3
Signed-off-by: Daniel Erez <derez@redhat.com>
Co-authored-by: Fred Rolland <frolland@redhat.com>
2018-11-29 01:15:01 +02:00
Alexander Wels
029604a7d2 Fixes incorrect call of resize.
Signed-off-by: Alexander Wels <awels@redhat.com>
2018-11-26 11:44:43 -05:00
tavni
05778eecff CDI e2e negative tests
Signed-off-by: tavni <tavni@redhat.com>
2018-10-17 11:04:41 +03:00
j-griffith
537bcd02b0 Update unit and functional tests 2018-10-12 22:07:43 -06:00
j-griffith
0a84e2fa8c Add lint checks to remaining go src directories
This finishes up the last of the golint implementation, with the
addition of the cmd, tests and tools directories we are now running
golint tests on all of the current go source files in the project.

This change adds all the little fixes (mostly just commenting and
naming) and also enables the new diretories in the lint test that we
gate on.
2018-09-29 08:35:21 -06:00
Alexander Wels
efae631d37 Try to debug the flaky http transport test.
- Updated glide dependencies.
- Fixed issue where if the qemu process was killed before all the output
  was read it would not return everything to the calling function.
- Added PrintPodLog method to print out the pod log.

Signed-off-by: Alexander Wels <awels@redhat.com>
2018-09-28 14:54:43 -04:00
Jon Cope
2281bf6d2c validate imported file size (#429) 2018-09-14 23:07:34 -07:00
John Griffith
c455577cca Fix lint errors on common package (#449)
This change just updates the common package to pass golint.  Of course
that has some reaching implications into other packages with renaming of
constants.

I've intentionally kept this patch set to the bare minimum for the lint
test, I do think that we should put some effort into our use of
constants (especially those in common.go) in the future.

Ideally we'd declare constants where they're used, and we wouldn't
export them if they don't need to be.  There are some in here that
are only used in one or two packages, and that can be cleaned up pretty
easily however it's likely that there might be plans to use them
elsewhere in the future.
2018-09-10 09:14:09 -04:00
Adam Litke
e4c54af6f7
Merge branch 'master' into streaming-qcow 2018-09-07 12:05:21 -04:00
Jeff Vance
7f01fbf6c5 pr 'make format' (#442) 2018-09-07 07:21:52 -04:00
Michael Henriksen
d9bbc4ed51 don't attempt to stream-convert http files that require creds 2018-09-06 20:40:56 -04:00
danielerez
9f72eeec40 common: fixed key constants capitalization (#412)
Fixed capitalization to correalte with other constants in the file.
2018-09-05 09:32:43 -07:00
Jon Cope
437154d701 Add http transport test suite and supporting utils (#376) 2018-08-31 11:48:03 -07:00