Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Check Files Key Exists in Generator #59

Merged
merged 5 commits into from
Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,7 @@ jobs:
- name: Test
run: |
make sops
# Github now comes with kustomize already installed
sudo rm $(command -v kustomize) || true
make kustomize
XDG_CONFIG_HOME=$HOME/.config make test
5 changes: 5 additions & 0 deletions ksops.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ func (p *plugin) Generate() (resmap.ResMap, error) {
// get a decrypted resmap for each files
var resources resmap.ResMap

// validate the files key exists
if p.Files == nil {
return nil, errors.New("missing the required 'files' key in the ksops manifests")
}

for _, f := range p.Files {
// check for err
r, err := decryptResource(p, f)
Expand Down