argocd-vault-plugin icon indicating copy to clipboard operation
argocd-vault-plugin copied to clipboard

enable templating keys with vault secrets

Open omrishiv opened this issue 1 year ago • 8 comments

Description

This commit allows the keys to be templated from secrets in addition to the values.

Fixes: #171

Checklist

Please make sure that your PR fulfills the following requirements:

  • [ ] Reviewed the guidelines for contributing to this repository
  • [ ] The commit message follows the Conventional Commits Guidelines.
  • [ ] Tests for the changes have been updated
  • [ ] Are you adding dependencies? If so, please run go mod tidy -compat=1.17 to ensure only the minimum is pulled in.
  • [ ] Docs have been added / updated
  • [ ] Optional. My organization is added to USERS.md.

Type of Change

  • [ ] Bugfix
  • [x] Feature
  • [ ] Code style update (formatting, local variables)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] New tests
  • [ ] Build/CI related changes
  • [ ] Documentation content changes
  • [ ] Other (please describe)

Other information

Allows templating the keys

omrishiv avatar May 14 '23 03:05 omrishiv

@OmriShiv Thanks for this PR. Things look good after some manual testing. Can you add a couple tests using inline and annotation, combining keys and values being replaced.

werne2j avatar May 14 '23 17:05 werne2j

Thanks for the quick review; I added the tests

omrishiv avatar May 14 '23 18:05 omrishiv

Hi @werne2j do the tests look ok?

omrishiv avatar May 17 '23 18:05 omrishiv

I will take a close look later this week. Could you also add to the fixtures, specifically the nonempty directory and the outputs, in order to run through the generate tests https://github.com/argoproj-labs/argocd-vault-plugin/blob/main/cmd/generate_test.go

werne2j avatar May 17 '23 21:05 werne2j

I added the fixtures to test and caught a case where <key>:<value> wasn't being templated. Now it should be

omrishiv avatar May 18 '23 03:05 omrishiv

Codecov Report

Merging #510 (611b4be) into main (717f1c0) will increase coverage by 0.10%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #510      +/-   ##
==========================================
+ Coverage   75.38%   75.48%   +0.10%     
==========================================
  Files          25       25              
  Lines        1694     1701       +7     
==========================================
+ Hits         1277     1284       +7     
  Misses        323      323              
  Partials       94       94              
Impacted Files Coverage Δ
pkg/kube/util.go 90.59% <100.00%> (+0.33%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar May 20 '23 23:05 codecov-commenter

@werne2j gentle nudge if this looks good. Thanks!

omrishiv avatar May 24 '23 14:05 omrishiv

@werne2j bumping again please

omrishiv avatar Jul 11 '23 03:07 omrishiv