Commit Graph

62 Commits

Author SHA1 Message Date
Tomasz Barański
536af6b1ad
Replace skopeo (#1322)
* Updated dependencies
Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* Replace skopeo with containers API.

This commit removes dependence on skopeo (binary) and uses containers
API. By doing that we're able to opimize the use of storage (scratch)
space, storage I/O and download bandwith.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* Fixing rebase - dependencies kerfuffle.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* Handling docker-format images as well as OCI.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* Fix for missing code-generator module.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* Remove regex, image file in registry images are matched by a path
prefix.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>

* Added nginx proxy in front of docker registry for a rate-limited access.

Signed-off-by: Tomasz Baranski <tbaransk@redhat.com>
2020-08-22 05:52:00 +02:00
Maya Rashish
5fede6938b
Make it possible to import images needing conversion from servers that don't support range requests (#1326)
* Combine tests in bad_webserver.go into a table

No functional change intended.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Use a QCOW2 image for testing badserver.

This has the benefit of going through qemu-img for conversion,
which can introduce more bugs.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Don't pass URLs to qemu-img if Accept-Ranges header isn't bytes.

Adapt unit tests so they don't also test this feature.
Add a handler to bad-webserver to do a very plain HTTP response
using a downloaded file from cdi-file-host. This one doesn't
come with builtin support for range requests.

Use this handler to test that CDI can still import images needing
conversion.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Invert polarity and test for "none".

It's highly unlikely that a value other than bytes becomes a
valid choice, but let's not rule that out.

Signed-off-by: Maya Rashish <mrashish@redhat.com>
2020-08-12 18:11:55 +02:00
Alexander Wels
9bfc4f94be
verify schema using travis. (#1336)
Signed-off-by: Alexander Wels <awels@redhat.com>
2020-08-11 19:27:55 +02:00
Michael Henriksen
75f4fd6f2f
update k8s deps to 18.6 and controller runtime to 0.6.2 (#1330)
* update k8s deps to 1.18.6 and controller runtime to 0.6.2

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

* remove building code generators from docker image.  This way the k8s ligray version only has to be updated in go.mod

Do more stuff in the bazel container.  Faster and better interop

Fix unit tests

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

* make format

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

* remove unnecessary rsync

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

* redo code generator dep management

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

* builder uses go modules

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2020-08-07 14:09:52 +02:00
Alexander Wels
6dce12f090
Move CRDS from apiextensions v1beta1 to v1. (#1307)
* Move CRDS from apiextensions v1beta1 to v1.
Ensure that our code based schema validation matches the types in the api.

Signed-off-by: Alexander Wels <awels@redhat.com>

* Ran go mod tidy and vendor in attempt to see if we could use newer runtime controller, but our go version too old.
Addressed review comments.

Signed-off-by: Alexander Wels <awels@redhat.com>

* Addressed more review comments and fixed k8s-1.18 functional test failing.

Signed-off-by: Alexander Wels <awels@redhat.com>

* Remove categories 'all' from cluster scoped CRDs

Signed-off-by: Alexander Wels <awels@redhat.com>
2020-08-01 01:01:50 +02:00
Michael Henriksen
9e2c79b1e0
move api groups to v1beta1 (#1232)
* move upload.cdi.kubevirt.io API group to v1beta1

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

* move core api to v1beta1

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

* fix os-3.11 cluster sync and add functional tests for alpha api

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

* change more occurences of v1alpha1

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

* updates after rebase

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2020-07-10 15:47:38 +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
Bartosz Rybacki
831fc3df94
New test case "delete file during import" (#1272)
* New test case "delete file during import"

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Code review fixes (const and cleanup)

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Use utility WaitPVCDeleted

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>
2020-07-06 20:17:37 +02:00
Bartosz Rybacki
ec38c570ef
Correct check in badserver_tests (#1262)
* Correct check in badserver tests

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Extend wait timeout for data volume success on flaky server

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Do not use filesystem for state

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Flaky server should only work on get.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>
2020-07-06 17:11:37 +02:00
Michael Henriksen
1b5c5fe0a9
use kubernetes openapi generator (#1222)
Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2020-06-03 22:47:35 +02:00
maya-r
93565b2c88
Implement local webserver to mimic flawed servers (for functional tests) (#1193)
* Implement local web server to mimic flawed servers

http://cdi-bad-webserver.cdi/flaky/filename will return a 503
"unavailable" error to most requests.

http://cdi-bad-webserver.cdi/forbidden-HEAD/filename will return
a 403 "Forbidden" error on HEAD requests.

In both those cases, we validate that we still eventually succeed
in creating a datavolume.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Add the imageio server to the manual test setup instructions.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Add missing bad-webserver.yaml.in (forgot to git add)

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Make "flaky" bad-webserver reproducibly flaky.

9 failures followed by a success.
Switch to port 9090, os-3.11 disallows using privileged ports,
and we don't have a reason to prefer port 80.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Provide polarion test IDs

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Make flaky test server fail less frequently.

The exponential backoff makes 10 retries very slow.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Tolerate being installed on a namespace that isn't "cdi"

Assume that we are in the same namespace as cdi-file-host, and
use that namespace in the URL.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Use AfterEach to cleanup datavolumes after test.

Suggested by Alexander Wels.

Signed-off-by: Maya Rashish <mrashish@redhat.com>
2020-05-08 00:01:19 +02:00
Alexander Wels
25249c0148
Add ember csi lane (#1143)
* Add loopback device container
Add code to create pv vg and lvm
Add ember csi lvm based provisioner.

Signed-off-by: Alexander Wels <awels@redhat.com>

* import/export

Signed-off-by: Alexander Wels <awels@redhat.com>

* Address PR comments.
Switch deployment to pod for loopback device
Sleep 1 instead of 60 to allow kubernetes easier way of killing pod.
Instead of embercsi master, grab one that works from known repo.

Signed-off-by: Alexander Wels <awels@redhat.com>

* Finish loopback pod instead of looping it.

Signed-off-by: Alexander Wels <awels@redhat.com>
2020-03-27 19:13:49 +01:00
Alexander Wels
886e76035e
Fix InsecureSkipVerify in imageio data source for http client. Use http data source client instead. (#1159)
Signed-off-by: Alexander Wels <awels@redhat.com>
2020-03-27 00:51:48 +01:00
Alexander Wels
f9c07ad0ea
Enable IPv6 on cdi http file host. (#1145)
Signed-off-by: Alexander Wels <awels@redhat.com>
2020-03-17 17:46:02 +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
Michael Henriksen
e24237031a
add CDIConfig to swagger (#1127)
Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2020-02-26 23:28:53 +01:00
Michael Henriksen
0b9fb15e86
operator create apiservice and webhook configurations (#1103)
Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2020-02-11 05:45:15 +01:00
Michael Henriksen
97c23cfa5a remove DOCKER_REPO from operator (#1022)
* remove DOCKER_REPO from operator

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

* make generate and update CDI schema

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2019-11-14 02:59:16 +01:00
Michael Henriksen
044ab60f52 cut down operator permissions (#1012)
* cut down operator permissions

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

* mage sure csv-generator is built but not included in operator image

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2019-11-11 22:41:14 +01:00
Alexander Wels
a67c64c338
initial bazelification of CDI (#986)
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-10-15 15:55:44 -04:00
Alexander Wels
4a20e29db3
Remove OLM integration as we aren't using it. (#982)
Removed OLM code since it is not being used in CDI deployment.

Signed-off-by: Alexander Wels <awels@redhat.com>
2019-10-07 18:34:07 -04:00
Michael Henriksen
254dc90835 create aggregate cluster roles (#961)
* create aggregate cluster roles

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

* CDIConfig needs a ClusterRoleBinding so bind to system:authenticated for reading

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

* comment out problematic test

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

* operator needs upload.cdi.kubevirt.io permission

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

* revert commented out tests

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
2019-09-18 19:03:49 -04:00
John Griffith
5c8877911c Fallback to Fedora29 minimal for images (#915)
The newer version of qemu-img (3.1.0) that ships in Fedora 30 has issues
with streaming conversions whereby it hangs during the conversion
process.  Rather than try to force a downgrade of qemu when building
images instead, let's try reverting back to Fedora29 minimal which has
qemu-img version  3.0.0.

This issue has also exposed the fact that we aren't performing any
testing against streaming external images, we're only testing against
images that we've pulled in to our test infrastucture.  So add a
functional test that builds a DataVolume directly from the cirros site.

set dv test back to expectin prlimit failure
2019-08-16 11:18:21 -04:00
David Vossel
c58fdc3e82 Properly handle replaces CSV version during manifest generation
Signed-off-by: David Vossel <davidvossel@gmail.com>
2019-08-05 14:41:58 -04:00
David Vossel
5aba0cc927 add option to dump operator crd info to stdout
Signed-off-by: David Vossel <davidvossel@gmail.com>
2019-08-02 10:24:33 -04:00
David Vossel
2292ea1700 Generate release CSV from code
Signed-off-by: David Vossel <davidvossel@gmail.com>
2019-08-02 10:11:27 -04:00
David Vossel
7ca8893edf csv-generator tool
Signed-off-by: David Vossel <davidvossel@gmail.com>
2019-08-02 10:11:27 -04:00
David Vossel
aadcc6ad9b move manifest marshaller into util package
Signed-off-by: David Vossel <davidvossel@gmail.com>
2019-08-02 10:11:27 -04:00
annastopel
ed5894cb08 * build fixes 2019-07-14 09:49:36 +03:00
annastopel
350508dc1c * convert olm bundle manifets' tree to operator-registry tree
* support case when olm bundle contains more than one crd version
2019-07-14 09:49:36 +03:00
Anna Stopel
7ad9bc2366 Olm upgrade (#817)
*     CDI OLM update support
    * Download latest CDI OLM manifest from marketplace to set replaces field
    * Prevent from genarting a csv version that already exist in  the marketplace

*     * Vendor the bellow packages in order to be able to fetch existing CSV
      - github.com/operator-framework/operator-marketplace
      - github.com/go-openapi/spec
      - github.com/go-openapi/validate
      - github.com/go-openapi/errors
      - github.com/go-openapi/analysis
      - github.com/go-openapi/strfmt
      - github.com/go-openapi/loads
      - github.com/go-openapi/runtime

* lint bug-fix

* CR fixes

* CR typo fixes

* * Split catalogsource/operatorsource/subscription manifests to k8s and os
* Update OLM documentation
* rename bundle-helper.go file

* * change CDI repository name in quay from cdi to cdi-operatorhub

* Update cdi-operator-olm.md
2019-06-19 16:35:58 -04:00
Daniel Erez
c9625162c1 datavolume_test: malicious qcow2 images
Added functional tests to ensure that malicious
qcow2 images are being rejected. I.e. the creation
of import datavolume should fail when converted to raw.

Change-Id: I3372105fdcd28b8e01811d7e6752f04f5dba9e0d
Signed-off-by: Daniel Erez <derez@redhat.com>
Signed-off-by: Fred Rolland <frolland@redhat.com>
Co-authored-by: Fred Rolland <frolland@redhat.com>
2019-06-04 12:53:08 +03:00
Artyom Lukianov
11321ae7e9 Set klog flags before flags parsing
Looks like before some of imports used glog package that set all flags
under init() method, but after dependencies code stopped to run glog
init() method on container creation, so we need to set flags from klog
and parse flags in the right order.
2019-05-16 09:38:37 +03:00
Alexander Wels
75ff2c9921
Merge branch 'master' into remove_tar_from_reader 2019-05-08 09:21:09 -04:00
Alexander Wels
630a23ef23 Fix a bunch of go score card issues.
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-05-06 16:52:03 -04:00
Alexander Wels
c30f3975d2 Remove tar from the readers
Signed-off-by: Alexander Wels <awels@redhat.com>
2019-05-03 08:37:45 -04:00
annastopel
f634cdaa17 CDI operator OLM integration:
- Generate OLM related manifests for CDI in _out/manifests/release/olm
      OLM bundle:
	- cdi CSV manifest
	- cdi crd manifest
	- cdi package manifest
     - operatorsource manifest
     - subscription manifest
     - operatorgroup manifest
- Modify cdi-operator role not to be cluster-admin but more specific
- Move all final manifests to _out/manifests directory and update travis with new manifests location
- Provide API for vendoring CDI OLM manifests generation code

Note:
  - OLM CSV update to be supported in a separate PR
  - OLM bundle integration in travis is to be supported together with CSV update
2019-05-01 13:54:28 +03:00
u5surf
6a2a36e1fd add copies the flags after flags parse 2019-03-07 23:20:34 +09:00
u5surf
8305db81bb fix lint 2019-03-07 08:37:34 +09:00
Y.Horie
43ca309494
Merge branch 'master' into issue-687 2019-03-06 23:31:37 +09:00
Michael Henriksen
08ce3ad394 https cert configuration 2019-03-05 18:15:33 -05:00
Y.Horie
0ac09120fd sync flags in klog 2019-03-05 20:55:43 +09:00
Y.Horie
c9104059fb move to klog from glog 2019-03-05 13:33:20 +09:00
Michael Henriksen
fdf87bc2d3 update go to 1.11.5 2019-02-27 09:29:19 -05:00
Michael Henriksen
717ceaa919 add ability for user to specify certs for import from registry 2019-02-18 09:06:46 -05:00
annastopel
b9edce9ef0 Import VM disk from ContainerDisk image 2019-02-12 21:11:39 +02:00
Michael Henriksen
5e2ed1b97b initial oerator implementation 2019-01-16 20:22:14 -05:00
Michael Henriksen
d02ed1d741 generate cdi-controller.yaml from resources defined in code 2019-01-11 10:15:03 -05:00
Michael Henriksen
b135463747 operator scaffolding 2019-01-08 16:03:21 -05:00
Michael Henriksen
2a0cd800b5 CDI operator CRD 2019-01-08 15:52:41 -05:00