Commit Graph

71 Commits

Author SHA1 Message Date
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
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
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
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
371e5c2ba0 Set pod restart policy to "OnFailure" and cleanup
This patch does two things:
1. We modify the restar policy from never to "OnFailure" for the
    Importer (we already did this for Upload, and we don't want to do it yet
    for the Clone pods)
2. Upon succesful completion delete our worker pods
    We're not doing this on failed pods right now because in general an
    admin will likely want to inspect the pod to see why it failed.

The first question someone will likely ask is "well what about a node
failure", well in the case of a node failure for CDI we have a bigger
outstanding issue remaining to figure out how to deal with volume
connections.  We can't just simply reschedule the job.
2018-10-09 08:25:22 -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
5eeee34e83 refactorings from rebase 2018-09-19 12:30:46 -04:00
Michael Henriksen
b806786da1 refactoring and unit tests 2018-09-19 12:30:46 -04:00
Michael Henriksen
762cf6860d api server create explicit key for signing 2018-09-19 12:30:46 -04:00
Michael Henriksen
6ae444d661 have upload controller create cert for upload proxy and configure upload proxy to get key/cert from secret 2018-09-19 12:30:46 -04:00
Michael Henriksen
3d5927d30a incorporate some review comments 2018-09-19 12:30:46 -04:00
Michael Henriksen
28d349f660 minor refactoring and fix lint failure 2018-09-19 12:30:45 -04:00
Michael Henriksen
8910df8cee real tls cert validation 2018-09-19 12:30:45 -04:00
Michael Henriksen
1cbabdc8cf refactor key/cert storage to just use secrets 2018-09-19 12:30:45 -04:00
Michael Henriksen
59e0af3485 tls for upload server 2018-09-19 12:30:45 -04:00
Michael Henriksen
cd81879806 initial implementation of upload controller and upload server 2018-09-19 12:30:45 -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
Alexander Wels
95ac761c63 Fix the standard PVC e2e test failing.
Signed-off-by: Alexander Wels <awels@redhat.com>
2018-09-06 09:47:50 -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
John Griffith
69709bf863 Update no annotation PVC import test. (#403) (#408)
- Set verbosity on controller to 3 to enable simpler tests.

Signed-off-by: Alexander Wels <awels@redhat.com>
2018-09-05 11:10:24 -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
Alexander Wels
5c43a1373e
Update no annotation PVC import test. (#403)
- Set verbosity on controller to 3 to enable simpler tests.

Signed-off-by: Alexander Wels <awels@redhat.com>
2018-09-05 08:09:30 -04: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
Alexander Wels
363572626d cloner image uses ENTRYPOINT instead of hard coded path (#375)
- Updated controller to use ENTRYPOINT (no cmd) instead of /bin/sh
- Updated Dockerfile to set path to /usr/bin/cloner_startup.sh instead of /tmp
- Updated Dockerfile to use ENTRYPOINT.

Fixed issue #374

Signed-off-by: Alexander Wels <awels@redhat.com>
2018-08-27 18:35:13 -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
zvikorn
723e22259d Having the cloning label in the target pod, make the pod affinity fails. (#280)
The target pod looks for a pod with a specific label (specified in the pod affinity) that matches the source pod label.
In my case the target pod included this label as well, so we can see that the target pod found matching pod, but it is the WRONG pod. It's itself!!
The target was running without finding the source pod first.
If we remove this label from the target pod, it will find the source pod and then will be scheduled on the same node.
If it does not find the source pod (because the scheduler tried to schedule it before the source pod), it will be in 'Pending' state until the source pod is scheduled, and then will be running on the same node.
https://github.com/kubevirt/containerized-data-importer/issues/279
2018-07-31 09:35:45 -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
tavni
b804b7bd7d Fixing PodAffinity by changing TopologyKey value and adding 'namespaces'
field
2018-07-18 14:59:51 +03:00
Jonathan Cope
aa82c9d577 Refactor random string gen to util.go (#258)
* Refactor random string gen to util.go

* unit test

* gofmt
2018-07-13 11:41:41 -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
Jon Cope
bcf269413d gofmt'd cmd, pkg, and test dirs (no change in cmd) 2018-07-06 14:45:10 -05:00
zvikorn
80b3180370 Host-assisted cloning integrated to CDI (#219)
* [WIP] Host-assisted cloning integrated to CDI

* changing back import from kubevirt.io to github.com/kubevirt

* [WIP] - changing code according feedback

* Applied comments

* changed PullPolicy

* applied comments

* minor fix for logging
2018-07-06 14:38:18 -05: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
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
Scott Creeley
ce83b0a57a refactor of util funcs 2018-05-22 14:00:18 -04:00
Jeff Vance
fbf4347a4f
Update util.go 2018-05-21 09:52:37 -07:00
jeff vance
fd13faa1aa change Patch to Update 2018-05-21 09:22:04 -07:00
Jon Cope
6cc5a1c4e5 Replaced all error returns with Dave Cheney's errors package
gofmt

removed unused import, fixed datastream interfae

Missed a fmt -> errors conversion

Stray fmt.Errorf replacement

vendor errors package

Wrapped controller main() scrope errors for uniformity, fixed double wrapping of errors
2018-05-15 15:12:53 -05:00
jeff vance
a835a15f26 add log verbosity 2018-05-14 15:35:36 -07:00
Jon Cope
2e918908a6 Add hyphen after pod name 2018-05-09 15:22:41 -05:00
jeff vance
2758e01a8d handle pvc.Get err 2018-05-08 17:37:40 -07:00
Jon Cope
6b863a2478 Add pod informer to controller
Start pod informer

also shutodwn podQueue

Added getting the PVC from pod's volume list using a global const for vol name

Generalized set-annotation func, added pod to pvc status writes

Use Filtered IndexInformer

Filter Pods by Label, examine all cluster PVCs

Resource dequeuing funcs return true unless key is malformed or processing succeeds

Pod correctly annotates PVC w/ status

Fix error message

Aligned log line with PVC func
2018-05-03 15:16:08 -05:00