mpen
mpen

Reputation: 283313

Json Patch: Append multiple?

Basically, how can I can combine these two operations?

- op: add
  path: /spec/template/spec/volumes/-
  value:
    name: php-src
    emptyDir: {}
- op: add
  path: /spec/template/spec/volumes/-
  value:
    name: nginx-src
    emptyDir: {}

If I try like this, it deletes the existing entries:

- op: add
  path: /spec/template/spec/volumes
  value:
    - name: php-src
      emptyDir: {}
    - name: nginx-src
      emptyDir: {}

I just want to append two new entries to the end of /spec/template/spec/volumes which is an existing array.

Upvotes: 0

Views: 1643

Answers (1)

Fritz Duchardt
Fritz Duchardt

Reputation: 11930

This is not possible - the Json Patch spec only allows for adding singular values.

Upvotes: 3

Related Questions