<p>When adding a kustomize patch to a <code>kustomization.yaml</code> the double quotes are replaced with single quotes that lead to error</p>
<p>I am using the following:</p>
<pre class="lang-sh prettyprint-override"><code>kustomize edit add patch --patch &quot;- op: add\n  path: /metadata/annotations/argocd.argoproj.io~1sync-wave\n. value: 1&quot; --kind Deployment
</code></pre>
<p>is converted to</p>
<pre class="lang-yaml prettyprint-override"><code>- patch: '- op: add\n  path: /metadata/annotations/argocd.argoproj.io~1sync-wave\n value: 1'
  target:
    kind: Deployment
</code></pre>
<p>in the <code>kustomization.yaml</code></p>
<p>This leads to the following error when you do <code>kustomize build</code></p>
<pre><code>Error: trouble configuring builtin PatchTransformer with config: `
patch: ‘- op: add\n path: /metadata/annotations/argocd.argoproj.io~1sync-wave\n  value:
  1’
target:
  kind: Deployment
`: unable to parse SM or JSON patch from [- op: add\n path: /metadata/annotations/argocd.argoproj.io~1sync-wave\n  value: 1]
</code></pre>
<p>How do I make sure that the patch in <code>kustomization.yaml</code> has double quotes instead?</p>

<p>Since I had hundreds of kustomization files that needed to be updated with the annotations for ArgoCD sync-waves, I worked around the problem by using <code>commonAnnotations</code> instead (I believe this is the right way of doing it as well). So instead of adding a patch, I did the following:</p>
<pre><code>kustomize edit add annotation argocd.argoproj.io/sync-wave:$wave --force
</code></pre>
<p>This will add the annotation to all objects. Where <code>$wave</code> was the wave number and <code>--force</code> overwrites the annotation if it already exists in the file.</p>
