I have the following deployment spec:
spec:
template:
spec:
volumes:
- name: config-web
configMap:
name: config-web-2-5
I want to use the kubernetes python client to change the name of ConfigMap from config-web-2-5 to config-web-3-0
def kubernetes_update_cm():
v1 = client.AppsV1beta1Api()
body = [{"op":"replace","path":"/spec/template/spec/volumes/0/config_map/name", "value": "config-web-3-0"}]
ret = v1.patch_namespaced_deployment(name="my-app", namespace="default", body=body)
return ret
However, the client returns the following error:
"message":"jsonpatch replace operation does not apply: doc is missing path: /spec/template/spec/volumes/0/config_map/name"
From the client src, I can see that this error occurs when the path isn't found in the deployment object.
Is this the correct path to use? There is only 1 volume in the deployment.