mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-06 06:55:21 +02:00
merge with master
This commit is contained in:
+13
-10
@@ -179,20 +179,14 @@ class EndToEndTestCase(unittest.TestCase):
|
||||
|
||||
# update the cluster-wide image of the logical backup pod
|
||||
image = "test-image-name"
|
||||
config_patch = {
|
||||
patch_logical_backup_image = {
|
||||
"configuration": {
|
||||
"logical_backup": {
|
||||
"logical_backup_docker_image": image,
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
k8s.api.core_v1.delete_namespaced_pod(operator_pod, "default") # restart reloads the conf
|
||||
k8s.wait_for_operator_pod_start()
|
||||
k8s.update_config(patch_logical_backup_image)
|
||||
|
||||
jobs = k8s.get_logical_backup_job().items
|
||||
actual_image = jobs[0].spec.job_template.spec.template.spec.containers[0].image
|
||||
@@ -319,12 +313,21 @@ 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 update_config(self, patch):
|
||||
k8s.api.custom_objects_api.patch_namespaced_custom_object(
|
||||
"acid.zalan.do", "v1", "default", "operatorconfigurations", "postgresql-operator-default-configuration", patch)
|
||||
|
||||
operator_pod = self.api.core_v1.list_namespaced_pod(
|
||||
'default', label_selector="name=postgres-operator").items[0].metadata.name
|
||||
self.api.core_v1.delete_namespaced_pod(operator_pod, "default") # restart reloads the conf
|
||||
self.wait_for_operator_pod_start()
|
||||
|
||||
def create_with_kubectl(self, path):
|
||||
subprocess.run(["kubectl", "create", "-f", path])
|
||||
|
||||
def apply_kustomization(self, path):
|
||||
subprocess.run(["kubectl", "apply", "-k", path])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user