Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

enable templating keys with vault secrets #510

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

omrishiv
Copy link

@omrishiv omrishiv commented May 14, 2023

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
  • 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

@werne2j
Copy link
Member

werne2j commented May 14, 2023

@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.

@omrishiv
Copy link
Author

Thanks for the quick review; I added the tests

@omrishiv
Copy link
Author

Hi @werne2j do the tests look ok?

@werne2j
Copy link
Member

werne2j commented May 17, 2023

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

@omrishiv
Copy link
Author

omrishiv commented May 18, 2023

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

@codecov-commenter
Copy link

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%) ⬆️

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

@omrishiv
Copy link
Author

@werne2j gentle nudge if this looks good. Thanks!

@omrishiv
Copy link
Author

@werne2j bumping again please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants