Commit Graph

50 Commits

Author SHA1 Message Date
Jon Cope
173c3b6f0f Test controller writes pod phase to pvc annotation
moved setupInformers to test-wide scope

Everything is broken

fake Patch isn't implemented

Tablize pod phase annotation testing

Cast phase to string in Expects; variable pod volume name

remove typo
2018-05-21 14:48:19 -05: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
4f0be9ca6b Fixed tests broken by add hyphen 2018-05-09 15:55:06 -05: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
Jon Cope
ad1729d594 Drop key if process succeeds 2018-04-27 16:11:08 -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
Scott Creeley
f724235372 add UpdateFunc to pvcInformer 2018-04-24 11:24:12 -04:00
Jeff Vance
9f968b1500
Merge pull request #102 from jeffvance/reader
Refactor readers so Close() is called
2018-04-19 09:05:50 -07:00
jeff vance
797e854b2c 1) rand tmp name for qemu, 2) gofmt changes 2018-04-18 16:14:15 -07:00
Jon Cope
558f2cb77f Additional build tags to test files 2018-04-17 16:39:44 -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
c65b47b852 pvc name per test, pvcObj per It 2018-04-10 10:34:04 -07:00
Scott Creeley
bec629511c fix controller unit test to be namespace aware 2018-04-09 21:14:53 -04:00
jeff vance
ba3eaa35d6 1st pass at ns unit test 2018-04-09 11:24:17 -07:00
Jon Cope
447177a506 Add functional testing for supported compression and archiving (excl
qcow2)

Fixed 'unexpected EOF' when reading test output (use io.Copy instead of ioutil.ReadAll), Test that input and output byte slices contain the same data

Extracted slice vars from loop

Fixed CreateTarXz/Gz funcs with correct calls (currently unimplemented)

Moved datastream tests to separate directory in prep for container work

Distinguish tests with build tags (unit v functional)
Add make recipe to functional test compilation, image build, and run

Improved Makefile output

Converted gz in-mem test to file read test, paremeterized importer Dockerfile to enable use as
test env, added build-args to Makefile for binary specific options.

Added xz test, condenced BeforeEach into It block (looping over BeforeEach causes unwanted behaviours)

Abstracted compression to single function, removed FileExt type (back to
strings), added tar test

Support nested format, add extention to convert function map
create base file with name provided in test table, no constant
added qcow2 conversion (broken: decompressed file is bigger than
original)

Extracted some setup to helper, add .tar.xz test
2018-04-06 18:03:17 -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
430af95714 Use proper gomega matchers 2018-03-19 20:02:52 -05:00
Jon Cope
7b3e49c080 Get Pod by generateName instead of Name 2018-03-19 17:41:42 -05: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
Shiyang Wang
123b7ac620 add importer test 2018-03-13 14:20:17 +08:00
Shiyang Wang
a356a47ec9 add validation unit test 2018-03-13 14:20:17 +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
Jon Cope
1c16573160 Don't return error for deleted pvc 2018-02-20 13:51:57 -06:00
Jon Cope
6fc802b241 Check annotation of pvc before processing 2018-02-20 13:45:56 -06:00
Jon Cope
0e34584c0b Done kill workers if business logic returns error 2018-02-16 16:01:10 -06:00
Jon Cope
064d2561e6 Add controller pod manifest 2018-02-16 14:46:46 -06:00
Jon Cope
001b1c64e0 Controller detects pvcs and calls empty work func (processItem). 2018-02-15 17:32:40 -06:00
Jon Cope
e28d6cb937 updated deps, added some dummy returns so the thing compiles 2018-02-15 11:10:09 -06:00
Jon Cope
7950d3f0fc Beginning structure of a controller 2018-02-14 17:20:15 -06:00