kubectl patch deplyoment results in 'The "" is invalid'

6/3/2019

I try to patch a deployment with the following command:

kubectl patch deployment spin-clouddriver -n spinnaker --type='json' -p='[{"op": "add", "path": "/spec/spec/containers/0/volumeMounts", "value": {"mountPath": "/etc/ssl/certs/java/cacerts", "subPath": "cacerts", "name": "cacerts"}}]'

which results in

The  "" is invalid

I don't see where is the error nor do I see how the message helps me to find the problem. Any hints?

-- papanito
kubernetes

1 Answer

6/3/2019

The correct path is "path": "/spec/template/spec/containers/0/volumeMounts. There was missing template key.

-- Suresh Vishnoi
Source: StackOverflow