title: kubectl patch: Is it possible to add multiple values to an array within a sinlge patch execution
body: <p>I tried to use <code>kubectl patch</code> to add two more values to the args list of a kubernetes deployment. I've gone over the officially documented (<a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/" rel="noreferrer">https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/</a>) variants but did not manage to append more than one value at a time.</p>
  <p>Assume this simple deployment:</p>
  <pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: test
  spec:
    replicas: 1
    selector:
      matchLabels:
        name: test
    template:
      metadata:
        labels:
          name: test
        name: test
      spec:
        containers:
        - image: alpine
          name: test
          command:
          - echo
          args:
          - my
          - text
  </code></pre>
  <p>I now want to append additional values to the <code>args</code> section. This works for a single value at a time:</p>
  <h3>Adding a single additional value</h3>
  <pre class="lang-sh prettyprint-override"><code>kubectl patch deployments.apps test --type=json -p='[{&quot;op&quot;: &quot;add&quot;, &quot;path&quot;: &quot;/spec/t
  emplate/spec/containers/0/args/-&quot;, &quot;value&quot;: &quot;additional&quot; }]'
  </code></pre>
  <p>This works and leaves me with the following:</p>
  <pre class="lang-yaml prettyprint-override"><code>...
          args:
          - my
          - text
          - additional
  </code></pre>
  <p>But running the patch with an array of values gives me an error:</p>
  <pre class="lang-sh prettyprint-override"><code># running:
  k patch deployments.apps test --type=json -p='[{&quot;op&quot;: &quot;add&quot;, &quot;path&quot;: &quot;/spec/template/spec/containers/0/args/-&quot;, &quot;value&quot;: [&quot;additional&quot;,&quot;text&quot;] }]'
  
  # results in:
  The request is invalid: patch: Invalid value: &quot;...&quot;: v1.Deployment.Spec: v1.DeploymentSpec.Template: v1.PodTemplateSpec.Spec: v1.PodSpec.Containers: []v1.Container: v1.Container.Args: []string: ReadString: expects &quot; or n, but found [, error found in #10 byte of ...|itional&quot;,[&quot;additiona|..., bigger context ...|{&quot;containers&quot;:[{&quot;args&quot;:[&quot;my&quot;,&quot;text&quot;,&quot;additional&quot;,[&quot;additional&quot;,&quot;text&quot;]],&quot;command&quot;:[&quot;echo&quot;],&quot;image&quot;:&quot;|...
  </code></pre>
  <p>Does anyone know a way to add mutliple values to an array within a single patch command without overwriting the whole args array? Thanks for your help.</p>