Commit Graph

51 Commits

Author SHA1 Message Date
Artyom Lukianov
40325745d0 Copy triple package from client-go repository
This package droped from client-go 1.13.4, so until
we will have find some good alternatives, we can use local copy.
2019-05-16 09:38:37 +03:00
Alexander Wels
309a46e72d Verify source and target PVC are correct before proceeding with clone.
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-04-18 10:17:34 -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
tavni
e0d4ec62b0 Fix for isue #1690415 - CDI appends 'source pod' to a label and may fail on error that label must not be longer than 63 characters
Signed-off-by: tavni <tavni@redhat.com>
2019-04-03 14:11:42 +03: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
afe77c3514 Allow missing storage class for scratch space, if none exists, create scratch PVC without SC
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-03-27 11:41:15 -04:00
Alexander Wels
d2ca78bec3 Use CDIConfig for scratch storage class.
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-03-21 15:37:07 -04:00
Alexander Wels
d1b7842a90 Resize on upload.
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-03-08 21:51:05 -05:00
Alexander Wels
1e46004ad2 Scratch space retry framework logic.
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-03-07 14:54:08 -05:00
Michael Henriksen
49a740d7ba make CDIConfig client cluster scoped and fix occasional crash 2019-03-04 18:54:58 -05:00
Michael Henriksen
931985658b add ready check to cdi controller and have upload proxy wait for it and the apiserver 2019-03-01 10:20:58 -05:00
Irit goihman
c199129e1f add 'cdi.kubevirt.io' label to cdiconfig and remove config on make cluster-clean
Signed-off-by: Irit goihman <igoihman@redhat.com>
2019-02-28 13:19:04 +02:00
Michael Henriksen
6f1d130d97 tests and review comments 2019-02-25 20:12:56 -05:00
Michael Henriksen
62f1e77f66 change INSECURE_REGISTRY to INSECURE_TLS because may want to have insecure hosts for http import 2019-02-25 20:12:56 -05:00
Michael Henriksen
3892a7310d add configmap for insecure regestries 2019-02-25 20:12:56 -05:00
Irit Goihman
1691fe1b39 create cdi config with config controller
Signed-off-by: Irit goihman <igoihman@redhat.com>
2019-02-24 10:23:35 +02:00
Michael Henriksen
717ceaa919 add ability for user to specify certs for import from registry 2019-02-18 09:06:46 -05:00
Michael Henriksen
27d6a606a8 cleanup resources made by controller when uninstalling and flush out status 2019-01-16 20:22:14 -05: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
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
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
Alexander Wels
260d4fa8e0 Automatically resize image to fit the requested PVC.
Combined code from PR#489 and PR#490 by
@gites and
@danielerez
Added some tests and rebased on current master.

Signed-off-by: Alexander Wels <awels@redhat.com>
2018-11-20 15:40:13 -05:00
Alexander Wels
70666e5946 Add source and contentType annotations
Signed-off-by: Alexander Wels <awels@redhat.com>
2018-11-14 12:20:26 -05:00
Alexander Wels
c485f39428 Properly label all CDI components.
Signed-off-by: Alexander Wels <awels@redhat.com>
2018-11-01 15:30:56 -04:00
Alexander Wels
edf39e1cc6
Merge branch 'master' into report_progress_cloner 2018-11-01 12:44:31 -04:00
Alexander Wels
40072b631a Report cloning progress in logs and prometheus.
Signed-off-by: Alexander Wels <awels@redhat.com>
2018-11-01 11:09:03 -04:00
Alexander Wels
f8dc6a8b59 Report import progress with prometheus
- Added code report progress with prometheus

Signed-off-by: Alexander Wels <awels@redhat.com>
2018-11-01 08:21:20 -04:00
Alexander Wels
4c762a8bab
Merge branch 'master' into cleaning 2018-11-01 08:07:28 -04:00
Alexander Wels
a5a82aa970 Report import progress with prometheus
- Added code report progress with prometheus

Signed-off-by: Alexander Wels <awels@redhat.com>
2018-10-31 11:26:38 -04:00
tavni
d7dce90bcb Removing unnecessary code and update Const UPLOAD name #506
Signed-off-by: tavni <tavni@redhat.com>
2018-10-28 16:17:28 +02:00
tavni
c7e40ebffd Add structure to hold all CDI importer environment variables #501
Signed-off-by: tavni <tavni@redhat.com>
2018-10-25 13:21:28 +03:00
j-griffith
537bcd02b0 Update unit and functional tests 2018-10-12 22:07:43 -06:00
Michael Henriksen
452e30bca7 add verification to functional test and change to shared pod phase annotation 2018-09-19 14:37:19 -04:00
Michael Henriksen
b806786da1 refactoring and unit tests 2018-09-19 12:30:46 -04:00
tavni
ce22c48834 CDI controller code dedupe
Signed-off-by: tavni <tavni@redhat.com>
2018-09-17 19:44:09 +03: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
David Vossel
7908038b94 Ensure expectation keys are deleted when object is deleted from cluster (#433)
Signed-off-by: David Vossel <davidvossel@gmail.com>
2018-09-07 08:38:28 -04:00
Jeff Vance
7f01fbf6c5 pr 'make format' (#442) 2018-09-07 07:21:52 -04:00
John Griffith
9468ba94c7 Fix golint errors on pkg directory (#414)
Note we are intentionally skipping test files for now, golint
pkg/controller... will skip them, so I'll skip them to.
2018-09-05 12:17:38 -07: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
John Griffith
e742a6cf63 Fix typo for "uniqe" (#397)
We have "CloneUniqeId", but we want "CloneUniqueID" (or something like
it)
2018-08-31 07:22:37 -04:00
zvikorn
d394d2de78 [WIP] CDI: expectations and single queue - cloning refactoring (#325)
[WIP] CDI: expectations and single queue - cloning refactoring

Adding 'expectPodCreate' call before creating target pod

minor change

Adding 'expectPodCreate' call before creating target pod

updating according feedback

Adding cloner unit test

code updates

Signed-off-by: tavni <tavni@redhat.com>

more updates

Signed-off-by: tavni <tavni@redhat.com>

minor change for util_test.go

Signed-off-by: tavni <tavni@redhat.com>

updating unit tests

Signed-off-by: tavni <tavni@redhat.com>

finished unit test for cloning refactoring

Signed-off-by: tavni <tavni@redhat.com>

rebase

Signed-off-by: tavni <tavni@redhat.com>

updating unit test after rebase

Signed-off-by: tavni <tavni@redhat.com>

gofmt errors

Signed-off-by: tavni <tavni@redhat.com>
2018-08-29 10:11:05 -07:00
John Griffith
8ca745b700 Run gofmt on our directories (#370)
Just do a simple `gofmt -s -w` on pkg, tests and controller directories
to fix the misc space/tab mixes and some other ez formatting issues.
2018-08-23 15:31:14 -07: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
Scott Creeley
59005c0d43 add unit tests for clone controller (#247) 2018-07-10 10:36:22 -07:00
David Vossel
97d87e39ef Import Controller Fixes (#238)
* Add owner references to import pod

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

* Unit test to verify import pod spec and the new owner references

Signed-off-by: David Vossel <davidvossel@gmail.com>
2018-07-09 09:30:57 -07:00
David Vossel
7106bf73dc Conform with top level kubevirt github project (#198)
* Place cdi packages under the top level kubevirt.io project path

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

* Change all references to cdi.io to cdi.kubevirt.io

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

* Add go_import_path to travis config

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

* update test package imports

Signed-off-by: David Vossel <davidvossel@gmail.com>
2018-06-21 15:44:52 -07:00
Scott Creeley
8ab15943bc add unit test for controller util.go 2018-06-21 10:12:18 -04:00
David Vossel
3e37aead88 Refactor cdi controller in preparation for multiple controllers
Signed-off-by: David Vossel <davidvossel@gmail.com>
2018-06-11 21:58:15 -04:00