Skip to content

Commit 128142a

Browse files
committedApr 15, 2021
Update api version, vendor & enhance testing
- update api project to v0.7.1 to pick up validator (and other) changes - update code paths which support skip tls but did not expose it - add test case and test data for annotation case sensitive validation - update test case to handle multiple errors - add .gitignore for artifacts generated from e2e tests - use mkcerts for better crossplatform SSL cert generation - create dedicated script for starting regsitry with & without SSL - implement e2e ctx (i.e. context) package - Provision impl for kind servers - Provision impl for kubeconfig (i.e. all other server types) - adjust makefile to account for `kind` build tag - allow e2e target to use focus flag - allow e2e target to use skip tls flag for local testing - adjust test.yml git action workflow to use start_registry script - adjust test.yml git action to remove kind (since its now dynamic) - add e2e documentation for all scenarios - use regex to determine possible kind control plane names - add --name argument for kind load docker-image call - update vendor Implements operator-framework#568 Signed-off-by: John Hunkins <[email protected]>
1 parent 0153d70 commit 128142a

File tree

249 files changed

+29596
-65
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+29596
-65
lines changed
 

‎.github/workflows/test.yml

+3-32
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,7 @@ jobs:
2424
sudo chown -R "$USER" "$HOME/.kube" "$HOME/.minikube"
2525
sudo usermod -aG docker "$USER"
2626
- run: |
27-
mkdir -p certs
28-
openssl req -x509 -newkey rsa:4096 -keyout certs/key.pem -out certs/cert.pem -days 365 -subj '/CN=localhost' -nodes -addext 'subjectAltName = DNS:localhost'
29-
docker run -d --restart=always --name registry -v "$(pwd)"/certs:/certs -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/cert.pem \
30-
-e REGISTRY_HTTP_TLS_KEY=/certs/key.pem \
31-
-p 443:443 \
32-
registry:2
33-
sudo mkdir /etc/docker/certs.d
34-
sudo mkdir /etc/docker/certs.d/localhost:443
35-
sudo cp certs/cert.pem /etc/docker/certs.d/localhost:443/ca.crt
36-
sudo cp certs/cert.pem /usr/local/share/ca-certificates/ca.crt
37-
sudo update-ca-certificates
27+
"${GITHUB_WORKSPACE}/scripts/start_registry.sh" minikube-registry
3828
export DOCKER_REGISTRY_HOST=localhost:443
3929
- run: |
4030
KUBECONFIG="$HOME/.kube/config" DOCKER_REGISTRY_HOST=localhost:443 make build e2e
@@ -47,26 +37,7 @@ jobs:
4737
sudo apt-get -y update
4838
podman version
4939
- run: |
50-
curl -sLo kind "$(curl -sL https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | jq -r '[.assets[] | select(.name == "kind-linux-amd64")] | first | .browser_download_url')"
51-
chmod +x kind
52-
sudo mv kind /bin/
53-
- run: |
54-
kind create cluster
55-
kind export kubeconfig
56-
sudo chown -R "$USER" "$HOME/.kube"
57-
sudo usermod -aG docker "$USER"
58-
- run: |
59-
mkdir -p certs
60-
openssl req -x509 -newkey rsa:4096 -keyout certs/key.pem -out certs/cert.pem -days 365 -subj '/CN=localhost' -nodes -addext 'subjectAltName = DNS:localhost'
61-
docker run -d --restart=always --name registry -v "$(pwd)"/certs:/certs -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/cert.pem \
62-
-e REGISTRY_HTTP_TLS_KEY=/certs/key.pem \
63-
-p 443:443 \
64-
registry:2
65-
sudo mkdir /etc/docker/certs.d
66-
sudo mkdir /etc/docker/certs.d/localhost:443
67-
sudo cp certs/cert.pem /etc/docker/certs.d/localhost:443/ca.crt
68-
sudo cp certs/cert.pem /usr/local/share/ca-certificates/ca.crt
69-
sudo update-ca-certificates
40+
"${GITHUB_WORKSPACE}/scripts/start_registry.sh" kind-registry
7041
export DOCKER_REGISTRY_HOST=localhost:443
7142
- run: |
72-
KUBECONFIG="$HOME/.kube/config" DOCKER_REGISTRY_HOST=localhost:443 make build e2e
43+
KUBECONFIG="$HOME/.kube/config" DOCKER_REGISTRY_HOST=localhost:443 make build e2e CLUSTER=kind

‎.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -462,3 +462,13 @@ pkg/apprclient/openapi/git_push.sh
462462
!test/**testdata/**
463463

464464
/coverage.out
465+
466+
# Test artifacts generated by e2e
467+
test/e2e/bundle.Dockerfile
468+
test/e2e/downloaded/**
469+
test/e2e/opm-*
470+
test/e2e/bundle_tmp*
471+
test/e2e/index_tmp*
472+
473+
# don't check in the certs directory
474+
certs/*

0 commit comments

Comments
 (0)
Please sign in to comment.