Commit Graph

42 Commits

Author SHA1 Message Date
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
Jon Cope
5dea5526ed Default pull policies to IfNotPreset unless env var is set
Fix testing, change env var & constant name
2018-04-30 10:43:25 -05:00
Scott Creeley
ed139bd58a fix possible race condition by checking annotation 2018-04-27 14:13:56 -04:00
Scott Creeley
9e671dfb57 add cdi label to pvc 2018-04-27 12:53:07 -04:00
Jon Cope
785424cd8f Refactor Controller to internally setup event handlers
Make CDI selector label a global constant

Parameterize selectorlabel

Handled nil selector case

Handel NewController error in testing, use constant importer tag

Changed informer factory back to un-filtered, fixed nil ptr error

removed labels, to be handled in a separate pr

To accomodate testing, NewController takes a pre-created Informer, not a factory

Add global constant for default resync

fix makefile bug

fix bug in deployent manifest
2018-04-26 15:34:35 -05:00
Jon Cope
d9dc1c92c8 Update makefile to push releases to kubevirt repo; Modify controller bin to accept non-default importer images
rename varibales to change 'tag' to 'image' references
2018-04-16 21:11:56 -05:00
jeff vance
cfeae65502 refactor unit tests 2018-04-06 13:08:08 -07:00
jeff vance
f9d6bf4f08 multiple namespaces 2018-04-02 15:55:51 -07:00
Jon Cope
a87c85b417 generate importer pod name, remote linux specific 2018-03-19 13:45:45 -05:00
Shiyang Wang
d06b6da42f add controller test 2018-03-13 17:49:54 +08:00
jeff vance
fcb2791de5 use Patch to update pvc anno 2018-03-05 20:59:30 -08:00
jeff vance
417df8890d replace status anno with importPodName, remove UpdateFunc and DeleteFunc 2018-03-01 23:57:28 -08:00
jeff vance
38d50cf051 support IMPORTER_TAG env var, include pvc name in importer pod name 2018-03-01 16:54:08 -08:00
jeff vance
d0906c4ff1 add common pkg and fix some err msgs to be more consistent 2018-02-27 13:11:42 -08:00
jeff vance
163fd1202c no explicit pvc requeue, use only secret name, and retry setting pvc status anno if stale 2018-02-27 09:41:58 -08:00
jeff vance
ae1d92ffd5 secret added to pod 2018-02-25 22:49:58 -08:00
jeff vance
e9f1fdd3e2 generate podName, create pod 2018-02-25 00:13:04 -08:00
jeff vance
d3587b4cf6 begin pod creation code, be retry is secret is missing 2018-02-24 00:24:04 -08:00
jeff vance
dcf163e0e8 look for pvc status annotation 2018-02-23 12:37:31 -08:00
jeff vance
4e9662b7af secret err handling 2018-02-22 18:24:18 -08:00
jeff vance
13c1c1209c secret and ep progress 2018-02-21 18:41:51 -08:00
jeff vance
ea293130ec controller action skeleton 2018-02-21 15:17:35 -08:00