-
Notifications
You must be signed in to change notification settings - Fork 49
Accept Sensitive for Secrets #436
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
Open
cocker-cc
wants to merge
1
commit into
theforeman:master
Choose a base branch
from
cocker-cc:Accept_Sensitive_for_Secrets
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found with puppet-foreman testing that this wouldn't work well with our installer. It writes out all the answers so you end up with
Sensitive[Undef], which isn't accepted here.So what you end with in the installer answers file is:
I think this translates to Hiera as:
katello::candlepin_db_password:So that ends up sending
undefvia Hiera. If you add a conversion to sensitive in Hiera using lookup_options, this ends up asSensitive[Undef].This would then also need to be reflected in all other types.
I merged theforeman/kafo#345, will release it shortly. I'm also considering a solution where we add the lookup option and use this option:
That would be a lot more straight forward. It may be breaking to users who pass in arguments directly from Puppet, but we can look at that.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no Knowledge, how the Installer-Answer-File works, but Hiera does not translate
to
katello::candlepin_db_password. Instead what Hiera does here, is: Lookup a Hash namedkatello, find the Hash namedkatello, which turns out to have a Key namedcandlepin_db_password.Isn't it possible to state an empty String
""instead of "nothing"in the Installer-Answer-File?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. What the installer does is that it extracts the default value from Puppet and stores that. Thinking more about it, other code would probably also fail, like
if $candlepin_db_password {}is "false" withundefbut perhapsSensitive[Undef]may not.I wonder if this is a more fundamental problem in Puppet and the lookup option may provide to only convert it if it isn't undef. Perhaps we need a conversion function that essentially is
to_optional_sensitive(Optional[Any]) -> Optional[Sensitive[Any]])(compared tosensitive(Any) -> Sensitive[Any]). Does that make sense?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this totally makes Sense.
I created an Issue in the Hiera-Board: https://tickets.puppetlabs.com/browse/HI-628
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! In theforeman/puppet-foreman#1018 we had a less structured discussion but I think I now understand the problem properly and I'm an issue there is helpful moving it forward. Thanks for distilling it down to the minimal problem statement.