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 | ||||
| 	@go test ./... | ||||
| 
 | ||||
| e2e: | ||||
| e2e: docker | ||||
| 	e2e/run.sh | ||||
| 	# TODO run before tests once they are implemented completely | ||||
| 	flake8 --exit-zero | ||||
|  |  | |||
|  | @ -4,4 +4,3 @@ nodes: | |||
| - role: control-plane | ||||
| - 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})" | ||||
| 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/ && | ||||
| kind delete cluster --name ${cluster_name} | ||||
|  | @ -4,7 +4,7 @@ from kubernetes import client, config, utils | |||
| from pprint import pprint | ||||
| import timeout_decorator | ||||
| import subprocess | ||||
| 
 | ||||
| import git | ||||
| 
 | ||||
| class K8sApi: | ||||
| 
 | ||||
|  | @ -13,6 +13,8 @@ class K8sApi: | |||
|        self.k8s_client = client.ApiClient() | ||||
|        self.core_v1 = client.CoreV1Api() | ||||
|        self.crd_api = client.CustomObjectsApi() | ||||
|        self.apps_v1 = client.AppsV1Api() | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| class SmokeTestCase(unittest.TestCase): | ||||
|  | @ -41,6 +43,26 @@ class SmokeTestCase(unittest.TestCase): | |||
|         for filename in ["configmap.yaml", "postgres-operator.yaml"]: | ||||
|             path = "manifests/" + filename | ||||
|             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 | ||||
|         while pod_phase != 'Running': | ||||
|  |  | |||
|  | @ -1,2 +1,4 @@ | |||
| kubernetes | ||||
| flake8 | ||||
| git | ||||
| timeout_decorator | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue