Add tests to check & document behavior of various ways to handle secrets in builds#727
Merged
rchincha merged 2 commits intoproject-stacker:mainfrom Oct 9, 2025
Conversation
make clean cleans more. adds additional bash test helper functions which make test writing a bit nicer Signed-off-by: Michael McCracken <mikmccra@cisco.com>
importing a shell file with secrets and sourcing it is the current best way to use secrets without hardcoding them in the stackerfile and without leaking them into the image or the process table using --substitute will result in the secrets ending up in the final image, because the substituted stackeryaml gets added as an annotation. This test confirms and documents this behavior, and gives us some confidence that we won't break this approach in the future unintentionally. Signed-off-by: Michael McCracken <mikmccra@cisco.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #727 +/- ##
=======================================
Coverage 60.43% 60.43%
=======================================
Files 59 59
Lines 6491 6491
=======================================
Hits 3923 3923
Misses 1920 1920
Partials 648 648 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ravi-ciroos
approved these changes
Oct 9, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a test file to show that --substitute is not a good way to pass secrets, and to ensure that we notice if we break the currently preferred way, using an import file.
Also adds some bats helpers which make test writing nicer.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.