diff --git a/meta-operator.py b/meta-operator.py index b705c71..cd8cc5e 100755 --- a/meta-operator.py +++ b/meta-operator.py @@ -105,7 +105,7 @@ async def apply_changes(operator, item, v1, revision, apps_api, api_instance): # Generate Services for name, body in transform_template(operator["spec"].get("services", [])): try: - await v1.patch_namespaced_service(name, namespace, body) + await v1.replace_namespaced_service(name, namespace, body) logger.info("Updated service %s/%s", namespace, name) except client.exceptions.ApiException: await v1.create_namespaced_service(namespace, body) @@ -114,7 +114,7 @@ async def apply_changes(operator, item, v1, revision, apps_api, api_instance): # Generate ConfigMaps for name, body in transform_template(operator["spec"].get("configmaps", [])): try: - await v1.patch_namespaced_config_map(name, namespace, body) + await v1.replace_namespaced_config_map(name, namespace, body) logger.info("Updated configmap %s/%s", namespace, name) except client.exceptions.ApiException: await v1.create_namespaced_config_map(namespace, body) @@ -125,7 +125,7 @@ async def apply_changes(operator, item, v1, revision, apps_api, api_instance): if replicas: body["spec"]["replicas"] = replicas try: - await apps_api.patch_namespaced_deployment(name, namespace, body) + await apps_api.replace_namespaced_deployment(name, namespace, body) logger.info("Updated deployment %s/%s", namespace, name) except client.exceptions.ApiException: await apps_api.create_namespaced_deployment(namespace, body) @@ -136,7 +136,7 @@ async def apply_changes(operator, item, v1, revision, apps_api, api_instance): if replicas: body["spec"]["replicas"] = replicas try: - await apps_api.patch_namespaced_stateful_set(name, namespace, body) + await apps_api.replace_namespaced_stateful_set(name, namespace, body) logger.info("Updated statefulset %s/%s", namespace, name) except client.exceptions.ApiException: await apps_api.create_namespaced_stateful_set(namespace, body)