Error encrypting tree: Error walking tree: Tree contains a non-string key (type <nil>): %!s(<nil>). Only string keys aresupported
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.1k
- Forks
- 1.1k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 9
Description
cat redis-vs-patch.yaml
- op: replace
path: /spec/http/0/match/0/headers/auth
value:
exact: my_key_to_be_encrypted
✗ cat redis-vs-patch.yaml | yq r - .value.exact
my_key_to_be_encrypted
✗ sops --encrypt --encrypted-regex 'exact' redis-vs-patch.yaml > redis-vs-patch.enc.yaml
Error encrypting tree: Error walking tree: Tree contains a non-string key (type <nil>): %!s(<nil>). Only string keys aresupported
Not sure what it's upset about. This is a Kustomize patch, and yq is happy with the format.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the command against redis-vs-patch.yaml and compare SOPS's tree-walking behavior with yq's interpretation of the Kustomize patch. Trace the encryption path that reports the nil key and determine what successful handling of the exact value should look like; the issue is done when this input encrypts without the non-string-key error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100