this is the code that i used in gitlab bash:
kubectl --kubeconfig=$KUBECONFIG -n $NAMESPACE_NAME patch service $CI_PROJECT_NAME -p '{"spec": {"selector": {"app.kubernetes.io/instance": "${HELM_NAME}-blue"}}}'
But when deploying, the following error is shown:
Error from server (BadRequest): invalid character ‘s’ looking for beginning of object key string
i want to using by kubectl patch <resource>
update an object.
Where is the problem with the code? Where am I doing wrong?
i think the error is about single and double quotation in json object. but i couldn’t find correct syntax.
Kasra Abdollahi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.