mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-09 07:55:49 +02:00
switch to opconfig CRD as default configuration
This commit is contained in:
+12
-9
@@ -44,11 +44,8 @@ class EndToEndTestCase(unittest.TestCase):
|
||||
operator_deployment["spec"]["template"]["spec"]["containers"][0]["image"] = os.environ['OPERATOR_IMAGE']
|
||||
yaml.dump(operator_deployment, f, Dumper=yaml.Dumper)
|
||||
|
||||
for filename in ["operator-service-account-rbac.yaml",
|
||||
"configmap.yaml",
|
||||
"postgres-operator.yaml"]:
|
||||
k8s.create_with_kubectl("manifests/" + filename)
|
||||
|
||||
k8s.create_with_kubectl("manifests/operatorconfiguration.crd.yaml")
|
||||
k8s.apply_kustomization("manifests")
|
||||
k8s.wait_for_operator_pod_start()
|
||||
|
||||
actual_operator_image = k8s.api.core_v1.list_namespaced_pod(
|
||||
@@ -182,12 +179,15 @@ class EndToEndTestCase(unittest.TestCase):
|
||||
|
||||
# update the cluster-wide image of the logical backup pod
|
||||
image = "test-image-name"
|
||||
config_map_patch = {
|
||||
"data": {
|
||||
"logical_backup_docker_image": image,
|
||||
config_patch = {
|
||||
"configuration": {
|
||||
"logical_backup": {
|
||||
"logical_backup_docker_image": image,
|
||||
}
|
||||
}
|
||||
}
|
||||
k8s.api.core_v1.patch_namespaced_config_map("postgres-operator", "default", config_map_patch)
|
||||
k8s.api.custom_objects_api.patch_namespaced_custom_object(
|
||||
"acid.zalan.do", "v1", "default", "operatorconfigurations", "postgresql-operator-default-configuration", config_patch)
|
||||
|
||||
operator_pod = k8s.api.core_v1.list_namespaced_pod(
|
||||
'default', label_selector="name=postgres-operator").items[0].metadata.name
|
||||
@@ -319,6 +319,9 @@ class K8s:
|
||||
def wait_for_logical_backup_job_creation(self):
|
||||
self.wait_for_logical_backup_job(expected_num_of_jobs=1)
|
||||
|
||||
def apply_kustomization(self, path):
|
||||
subprocess.run(["kubectl", "apply", "-k", path])
|
||||
|
||||
def create_with_kubectl(self, path):
|
||||
subprocess.run(["kubectl", "create", "-f", path])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user