`no matching destination found in config` when publishing to vault if directory have other files
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.1k
- Forks
- 1.1k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 9
Description
sops --config .sops.yml --verbose publish --recursive secrets
[SOPS] INFO[0000] Data key recovered successfully
[SOPS] DEBU[0000] Decrypting tree
uploading /secrets/project/a/prod/credentials.enc.yml to 127.0.0.1:8200/v1/secrets/data//project/a/prod/credentials.enc.yml ? (y/n): y
error loading config: no matching destination found in config
Because of parameters.yml sops cannot publish further after that file, even if my regex doesn't capture it.
.
└── project
├── a
│ └── prod
│ ├── credentials.enc.yml
│ └── parameters.yml <-- Cause of fail
└── b
└── base
└── credentials.enc.yml
.sops.yaml
[...]
destination_rules:
- vault_path: "/"
vault_kv_mount_name: "secret/"
vault_kv_version: 2
path_regex: .*\/project\/.*\.enc\.yml$
Testing the regex:
find . -type f | grep -E '^.*/project/.*\.enc\.yml$'
./secrets/project/a/prod/credentials.enc.yml
./secrets/project/b/base/credentials.enc.yml
If I remove parameters.yml (which is empty), publishing with sops works perfectly. I also tried copying the content of credentials.enc.yml to parameters.yml without success
Thanks for any help!
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 with the publish --recursive secrets command and the destination_rules handling for .sops.yml or .sops.yaml; reproduce the issue with the shown tree, including empty parameters.yml. Trace why an unmatched file stops publishing, then verify that matching *.enc.yml files are still uploaded while unrelated files are skipped.
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
- 38/100