Skip to content

Commit 11fd811

Browse files
felixfonteinduthils
andcommitted
add command unset
Converted from getsops/sops@1c2714d Co-authored-by: Sebastien Duthil <duthils@duthils.net> Signed-off-by: Sebastien Duthil <duthils@duthils.net> Signed-off-by: Felix Fontein <felix@fontein.de>
1 parent c52ad59 commit 11fd811

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

content/en/docs/_index.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,24 @@ The value must be formatted as json.
15141514
$ sops set ~/git/svc/sops/example.yaml '["an_array"][1]' '{"uid1":null,"uid2":1000,"uid3":["bob"]}'
15151515
```
15161516
1517+
## Unset a sub-part in a document tree
1518+
1519+
Symmetrically, SOPS can unset a specific part of a YAML or JSON document, by providing
1520+
the path in the `unset` command. This is useful to unset specific values, like keys, without
1521+
needing an editor.
1522+
1523+
``` sh
1524+
$ sops unset ~/git/svc/sops/example.yaml '["app2"]["key"]'
1525+
```
1526+
1527+
The tree path syntax uses regular python dictionary syntax, without the
1528+
variable name. Set to keys by naming them, and array elements by
1529+
numbering them.
1530+
1531+
``` sh
1532+
$ sops unset ~/git/svc/sops/example.yaml '["an_array"][1]'
1533+
```
1534+
15171535
## Showing diffs in cleartext in git
15181536
15191537
You most likely want to store encrypted files in a version controlled

0 commit comments

Comments
 (0)