submit custom operator images
This commit is contained in:
parent
806ca7ba81
commit
30e7445c80
3
Makefile
3
Makefile
|
|
@ -92,7 +92,6 @@ test:
|
||||||
hack/verify-codegen.sh
|
hack/verify-codegen.sh
|
||||||
@go test ./...
|
@go test ./...
|
||||||
|
|
||||||
e2e:
|
e2e: docker
|
||||||
e2e/run.sh
|
e2e/run.sh
|
||||||
# TODO run before tests once they are implemented completely
|
|
||||||
flake8 --exit-zero
|
flake8 --exit-zero
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,3 @@ nodes:
|
||||||
- role: control-plane
|
- role: control-plane
|
||||||
- role: worker
|
- role: worker
|
||||||
- role: worker
|
- role: worker
|
||||||
- role: worker
|
|
||||||
|
|
|
||||||
|
|
@ -18,5 +18,8 @@ kind create cluster --name ${cluster_name} --config ./e2e/kind-config-smoke-test
|
||||||
export KUBECONFIG="$(kind get kubeconfig-path --name=${cluster_name})"
|
export KUBECONFIG="$(kind get kubeconfig-path --name=${cluster_name})"
|
||||||
kubectl cluster-info
|
kubectl cluster-info
|
||||||
|
|
||||||
|
version=$(git describe --tags --always --dirty)
|
||||||
|
kind load docker-image "registry.opensource.zalan.do/acid/postgres-operator:${version}" --name ${cluster_name}
|
||||||
|
|
||||||
python3 -m unittest discover --start-directory e2e/tests/ &&
|
python3 -m unittest discover --start-directory e2e/tests/ &&
|
||||||
kind delete cluster --name ${cluster_name}
|
kind delete cluster --name ${cluster_name}
|
||||||
|
|
@ -4,7 +4,7 @@ from kubernetes import client, config, utils
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
import timeout_decorator
|
import timeout_decorator
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import git
|
||||||
|
|
||||||
class K8sApi:
|
class K8sApi:
|
||||||
|
|
||||||
|
|
@ -13,6 +13,8 @@ class K8sApi:
|
||||||
self.k8s_client = client.ApiClient()
|
self.k8s_client = client.ApiClient()
|
||||||
self.core_v1 = client.CoreV1Api()
|
self.core_v1 = client.CoreV1Api()
|
||||||
self.crd_api = client.CustomObjectsApi()
|
self.crd_api = client.CustomObjectsApi()
|
||||||
|
self.apps_v1 = client.AppsV1Api()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SmokeTestCase(unittest.TestCase):
|
class SmokeTestCase(unittest.TestCase):
|
||||||
|
|
@ -42,6 +44,26 @@ class SmokeTestCase(unittest.TestCase):
|
||||||
path = "manifests/" + filename
|
path = "manifests/" + filename
|
||||||
utils.create_from_yaml(k8s_api.k8s_client, path)
|
utils.create_from_yaml(k8s_api.k8s_client, path)
|
||||||
|
|
||||||
|
# submit most recent operator image built locally; see VERSION in Makefile
|
||||||
|
repo = git.Repo(".")
|
||||||
|
version = repo.git.describe("--tags", "--always", "--dirty")
|
||||||
|
|
||||||
|
body = {
|
||||||
|
"spec": {
|
||||||
|
"template": {
|
||||||
|
"spec": {
|
||||||
|
"containers": [
|
||||||
|
{
|
||||||
|
"name" : "postgres-operator",
|
||||||
|
"image": "registry.opensource.zalan.do/acid/postgres-operator:" + version
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
k8s_api.apps_v1.patch_namespaced_deployment("postgres-operator", "default", body)
|
||||||
|
|
||||||
pod_phase = None
|
pod_phase = None
|
||||||
while pod_phase != 'Running':
|
while pod_phase != 'Running':
|
||||||
pods = k8s_api.core_v1.list_namespaced_pod('default', label_selector='name=postgres-operator').items
|
pods = k8s_api.core_v1.list_namespaced_pod('default', label_selector='name=postgres-operator').items
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
kubernetes
|
kubernetes
|
||||||
flake8
|
flake8
|
||||||
|
git
|
||||||
|
timeout_decorator
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue