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

Allow unconfigured secrets provider if it is passed via cli args #101

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 4 additions & 1 deletion k8t/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ def cli_gen(method, value_files, cli_values, cname, ename, suffixes, secret_prov
config.CONFIG = config.load_all(directory, cname, ename, method)

if secret_provider is not None:
config.CONFIG['secrets']['provider'] = secret_provider
config.CONFIG = deep_merge(
config.CONFIG,
{'secrets': {'provider': secret_provider}}
)

eng = build(directory, cname, ename)

Expand Down
6 changes: 6 additions & 0 deletions tests/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,11 @@ def test_gen():
assert result.exit_code == 0
assert result.output == file.read()

result = runner.invoke(root, ['gen', 'tests/resources/no_secrets_provider'])
assert result.exit_code == 1

result = runner.invoke(root, ['gen', '--secret-provider', 'random', 'tests/resources/no_secrets_provider'])
assert result.exit_code == 0


# vim: fenc=utf-8:ts=4:sw=4:expandtab
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
secret: "{{get_secret('/test', 12) | b64encode}}"