* Run 'make format && make generate'
Seems like this hadn't been run in a long while.
Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>
* Run 'golangci-lint --fix' when using 'make format'
Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>
* Update golangci-lint version
Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>
* Remove gofmt
Golangci-lint already runs gofmt internally (see ./.golangci.yml)
Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>
* Remove golint pass
This linter has been deprecated since May 9, 2021. Golangci-lint already
covers its functionality
Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>
* Remove goimports
Golangci-lint already runs goimports internally (see ./.golangci.yml)
Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>
* Move govet into golangci-lint
This way we don't parse the project twice.
Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>
* Update README
Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>
* Run formaters and generators again
Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>
---------
Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>
* Run `make deps-update`
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Update to ginkgo v2
Avoid using table extension to avoid compilation errors
Switch to v2 everywhere
Update qe-tools as well (required)
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Fix/avoid deprecation warnings
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Do not use v1 reporter
For unit tests: stop using custom reporter, unnecessary
For functional tests: borrow code from kubevirt to keep reporting
Avoid deprecated warnings by golangci for using deprecated reporter
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Increase ginkgo timeout to 24h (default in ginkgo v1)
this may seem excessive, but we have a lower timeout in Prow, let's save
ourselves the future trouble of bumping timeouts in two places.
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* use the ginkgo built-in junit reporter
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Avoid using deprecated --ginkgo.noColor, use --ginkgo.no-color instead
Signed-off-by: Maya Rashish <mrashish@redhat.com>
---------
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Retire ember LVM code, unused
(Rationale: avoid having to change more things for changing the
base image)
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Remove unreferenced files from WORKSPACE
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Switch to centos:stream9 as a base image.
It has a significantly longer support cycle than Fedora releases,
and supposedly offers vulnerability scans.
Add a tinyCore.vdi to the repo instead of generating it.
The centos qemu-img has read-only VDI support, so we can't generate
it. Generate it using my system and add to the file-host.
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Use full names for pulls from dockerhub
CentOS doesn't like short tags
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Avoid specifying checksum for CentOS images.
They expire faster than we can update checksums, this is unfortunate
but perhaps they will soon publish images at a lower rate allowing
us to keep up.
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Bump number of open file limit to avoid bazel crashes
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Update builder to include #2087, builder based on centos stream9
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Update checksums that seem wrong
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Update ovirt links: old ones were removed
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Remove unused RPMs
Noticed due to: duplicated checksum but no problem in testsuite,
lack of aarch64 equivalent.
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Put nbdkit-vddk-plugin back for amd64.
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Use quay.io instead of dockerhub.
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Install util-linux-core for /usr/sbin/blockdev
Needed after #2174
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Update nbdkit/libnbd/nginx/ovirt versions to the latest
The previous version we were using can't be fetched any more
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Generate our own CentOS stream9 image using RPMs
Now updating the dependencies can be done by running `make rpm-deps`
and committing the change, like kubevirt.
This creates a small complication that we need to run update-ca-trust
to trust root CAs. Do this on the pod, using the entrypoint to do so.
Use a single image with all the dependencies for the test tools, we
don't benefit from making them minimal and it saved some trouble in
the conversion.
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Fixup imageio test container
Run update-ca-trust and update-crypto-policies before running
ovirt-imageio, to stop error messages.
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Use a more descriptive name for variable.
(Part of more inclusive language initiative)
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Avoid references to "master" branch when "main" is default
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Rename the functional test "master" flag to "kubeURL".
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Add a script to check for new additions of non-inclusive language
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* cdi-api-reference default branch is master, add an exception for it.
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* api: Add new ImportProxy structure to CDIConfig in v1beta1 core api
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* common: Add constants related to configure Import proxy in Import pod and controller reconcile
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* config controller: Add import proxy reconcile, monitoring OCP proxy updates
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* config controller: Add unit test for import proxy reconcile, monitoring OCP proxy updates and creating Secret and ConfigMap
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* import controller: Add unit support of ImportProxy in the tests
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* controller util: Add support to retrieve an OpenShift cluster wide proxy object as well as its needed configurations
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* controller util: Add unit test for the get cluster wide proxy functionality
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* controller: moved isOpenshift function to utils common and export it
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* importer: Clone http transport to keep the default proxy config such as the usage of environment variables and add support for proxy CA
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* operator: Update CDIConfigCRD with import proxy info
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* operator: Update CDIListCRD with import proxy info
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* operator: Add service account rights to CDI for accessing OpenShift proxy obj
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* operator: Add OpenShift proxy obj scheme support
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* test: Add new forwarding proxy for testing things that require a proxy
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* test: Add test to verify the importer pod with proxy
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* doc: Update cdi config doc with the ImportProxy info
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* add support to build the new proxy docker image
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* test: remove unwanted F parameter from test
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* controller: fix error handling
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* test: update the used method to get the pod of the importer pod and proxy
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* fixed comments from the revision
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* controller config: update the methods to use the log object from the reconcile object
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* controller: update function GetImportProxyConfig to return errors and include a new unit test
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* controller: add back a test that was removed by mistake
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* update updateCDIConfigByUpdatingTheClusterWideProxy function
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* test: decrease the import pod log pooling interval and increase the image size to be able to verify the import pod before it is deleted
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* test: update the pvc and proxied requests verification
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* tools: add X-Forwarded-For header in the proxy requests used for testing
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* test: reset cluster wide proxy with the original values
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* test: fix proxy update to change spec instead of status and other minor updates
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* doc: update import proxy description
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* update generated files
Signed-off-by: Marcelo Amaral <marcelo.amaral1@ibm.com>
* Make the k8s-1.18 lane the default
This is so we can remove the k8s-1.15 lane.
We don't run this lane in CI.
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Remove k8s-1.16 cluster-sync support.
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Remove k8s-1.15 cluster-sync support.
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* Update documentation regarding default KUBEVIRT_PROVIDERs
Signed-off-by: Maya Rashish <mrashish@redhat.com>
* 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>
* Add make tagret docker-olm-catalog
* Add build-olm-catalog script that builds tree expected by operator-registry.
* add catalogsource manifest to deploy operator registry per provider
* os
* k8s
* update olm documentation with opertor-registry deployment
Now using OKD 4.1.2 instead of 4.1.0.
k8s-1.13.3 and os-3.11.0-crio now using latest version of local volume provisioner:v2.3.2
Signed-off-by: Alexander Wels <awels@redhat.com>
* Remove a flaky part of the test that didn't add value.
Signed-off-by: Alexander Wels <awels@redhat.com>
Updated k8s image to latest.
Refactored cluster up to allow for adding more providers easily.
Signed-off-by: Alexander Wels <awels@redhat.com>
* Updated k8s image to latest.
Refactored cluster up to allow for adding more providers easily.
Enable OKD 4.1 provider
Signed-off-by: Alexander Wels <awels@redhat.com>
- 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
cdi-func-test-registry-host - a host that runs docker registry and is accessible from inside the cluster via
cdi-func-test-registry-host.kube-system host name. The registry is populated with images taken from /tmp/shared/images. It is used by functional tests.
Example of usage:
1. inspect
With skopeo acces registry to ispect image built from /tmp/shared/images/tinyCore.iso
skopeo inspect --tls-verify=false docker://cdi-func-test-registry-host.kube-system/tinycore.iso
2. Copy
skopeo copy --src-tls-verify=false docker://cdi-func-test-registry-host.kube-system/tinycore.iso dir:/tmp/download
Technical details:
Registry is run in a dedicated service cdi-func-test-registry-host.
In the same pod there are 3 containers:
1. cdi-func-test-registry - runs registry:2 with self signed certificate that listens on port 443
2. cdi-func-test-registry-init - used to pouplate /tmp/shared/images volume with images created from /test/images/tinuCore.iso and with certificate generated during container image build
3. cdi-func-test-registry-populate - encapsulted all images of /tmp/shared/images in docker images and pushes them to the registry
Added a note about running specific functional tests using
ginkgo command line options.
Change-Id: I5e1cb8f1f20fa170d2cf989870ee57c263e04f93
Signed-off-by: Daniel Erez <derez@redhat.com>
* Unify redundant test scripts under test target and aliases
Remove func tests from travis - unsupported env
* func tests wrap generic test script
* address comments
- Added functional test framework similar to kubevirt one.
- Added basic sanity test to demonstrate framework.
- Updated some vendor packages.
Signed-off-by: Alexander Wels <awels@redhat.com>
- Added ability to call make cluster-up to start a kubevirt cluster.
- Added ability to call make cluster-down to stop a kubevirt cluster.
- Added ability to call make cluster-sync to build CDI and sync it with
the running cluster. This allows for testing during development.
- Added cli.sh and kubectl.sh just like kubevirt, in the CDI project to
manipulate a running cluster.
- You can use k8s or OCP providers like kubevirt.
Signed-off-by: Alexander Wels <awels@redhat.com>
Adds go templated controller manifest
Adds make targets for template generation
Removes hard coded version values
Enables template generation and publishing in CI
* Use bash scripts to handle build workflow in docker containers
Added working docker builder/runner
Added _out to gitignore, stub script files
Added build and test scripts
small tweaks
Remove install opt, no need and create perm issues
Do func test for 'test' recipe, add non-docker option
Added QoL recipe alias, refactored test and build loops
centralized dockerfiles under hack/build/docker, renamed check/pre-check to format
Prefixed cmd/cdi- to main func files, added clean up scipt
simplified controller and importer dockerfiles, removed os/arch from bin name
DOCKER=1 - use docker
Travis and makefile changes
Don't go vet project in 'all' target (error in generated code), finished image builds
Small optimization to cdi-cloner image build
renamed build-images to build-docker; added make image aliases
testing version.sh
travis script calls new make targets, dropped version func (overly engineered for what we need)
deleted shift-tag.sh because it's just bad practice
Fix travis sed command
release :latest on PR merge
* Functional test refactoring
Removed test output files
renamed file vars to reflect purpose
Condensed test table definition, create tmp dir per test iteration
Refactored convertion funcs to write to a given directory, changed datastream test to create a temp dir and pass to file conversion, removed unused func
use randAlpahNum for tmp dir suffix, pepper in debug code
Must copy source file to tmp dir, then gzip/xzip, added debug code, package URL is deforming the file:// path by treating path[0] element as the server root
Fixed xz, gzip, tar, and noop test file generation; added copy of src to test dir if not present
Fixed typo in qemu-img cmd
Removed commented out line
* Added vet make target, updated hack/README
Make recipe call vet recipe
Updated hack/README
Makefile alias fix, clean all bin and _out except .gitignore, reverted 'vet' go_opt behavior
pulled 'vet' references from readme until it is fixed later
Don't delete the entire repo if _out doesn't exist,
* Moved clone script to cmd/ to make build flow smoother, now copy Dockerfiles to respective _out/cmd/* dirs for building container, delete old.Makefile
* Solidify build scripts
Text typos and comment additions
change cp glob to Dockerfile
Added push target to push images to non-kubevirt repo, updated README
Added license blocks, updated README with make vars, deleted empty script files
Added license to Makefile
Tweaked travis.yaml, removed version file (unused)
Fixed source paths
Fixing travis script sourcing
Moved shebang to line 1
Fixed shfmt install
Changed cloner script path in format.sh
Filter our vendor and pkg/client on go vet
Fix shfmt install in container, containerized clean target
Re-added Z opt to bind-mount
removed duplicate source line
Fix shfmt var expansion
formatting
Add non-docker cleanup optino
* wip: infer file formats
* add some of jon's code
* outer for loop; compiles
* closer... fix panic, rm processed known hdrs
* tar magic # fix
* nested rdrs,tar,qcow2 size work
* go-ify code
* size works for standalone test but not func-tests
* func test run
* gofmt and validate.go cleanup
* fix my bad rebase against 198
* review comments
* review2