-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: updates handling of github token to use a default string instead…
… of null (#339) * fix: set the ANCHORE_GITHUB_TOKEN to "default-unset" instead of null, and add tests Having a non-null string value ensures proper rendering of the value into the secret and is a no-op when the anchoreConfig.feeds.drivers.github.enabled property is false. When a user enables that flag, it is expected that the token value is set to a non-default value in order for the driver to work. Signed-off-by: Zach Hill <zach@anchore.com> * Update secret_test.yaml --------- Signed-off-by: Zach Hill <zach@anchore.com> Co-authored-by: Brady Todhunter <bradyt@anchore.com>
- Loading branch information
1 parent
bc2f194
commit 0ff7521
Showing
6 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
suite: Secret Tests | ||
templates: | ||
- secret.yaml | ||
release: | ||
name: test-release | ||
namespace: test-namespace | ||
chart: | ||
version: 9.9.9 | ||
appVersion: 9.9.9 | ||
tests: | ||
- it: should not render github driver token in the secret when github driver is not enabled | ||
template: secret.yaml | ||
values: | ||
- values.yaml | ||
asserts: | ||
- notExists: | ||
path: stringData.ANCHORE_GITHUB_TOKEN | ||
- it: should render github driver token in the secret correctly when driver is enabled & token is set | ||
template: secret.yaml | ||
set: | ||
anchoreConfig.feeds.drivers.github.token: foobar | ||
anchoreConfig.feeds.drivers.github.enabled: true | ||
asserts: | ||
- equal: | ||
path: stringData.ANCHORE_GITHUB_TOKEN | ||
value: "foobar" |