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

Add support for defining custom puppet.conf when generating types #993

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

treydock
Copy link
Contributor

No description provided.

justinstoller
justinstoller previously approved these changes Dec 3, 2019
Copy link
Member

@justinstoller justinstoller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The request makes sense. I'm a little unclear on the option handling - and I'm unclear if that's my own misunderstanding of what's currently required (we've had regressions in upstream CRI behavior and so have had to do wonky things in the past - or an issue in the code.

However, it copies the functionality of --puppet-path, which imo is what we want. So, assuming this works correctly for the submitter, I'm good with it.

@adrienthebo
Copy link
Contributor

@treydock thanks for submitting this pull request! This pull request has some outstanding merge conflicts, are you still interested in getting this PR merged?

@treydock
Copy link
Contributor Author

I resolved conflicts

lib/r10k/cli/deploy.rb Outdated Show resolved Hide resolved
mwaggett
mwaggett previously approved these changes Apr 22, 2020
Copy link
Contributor

@mwaggett mwaggett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, @treydock ! We've tracked down the test failure and it's being fixed in another PR, so once that goes in, we'll retest this and then we should be good to go! Thanks for your contribution!

@mwaggett
Copy link
Contributor

hey @treydock , sorry for all the churn, but would you mind resolving conflicts again and rebasing off master? We recently merged changes that fix breakages we were seeing. Thanks so much!

@treydock
Copy link
Contributor Author

@mwaggett I've rebased

mwaggett
mwaggett previously approved these changes Apr 27, 2020
Copy link
Contributor

@mwaggett mwaggett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

adrienthebo
adrienthebo previously approved these changes Apr 28, 2020
Copy link
Contributor

@adrienthebo adrienthebo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got a couple of suggestions, but no blockers. @treydock if you see value in making the suggested changes please do; either way we can merge this in the next couple of days. Thanks for the contribution!

@@ -31,6 +31,13 @@ def self.command
exit 1
end
end
option nil, :'puppet-conf', 'Path to puppet.conf', argument: :required do |value, cmd|
unless File.readable? value
$stderr.puts "The specified puppet.conf #{value} could not be read."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use the logger method as it's defined on commands; the following should work:

Suggested change
$stderr.puts "The specified puppet.conf #{value} could not be read."
logger.fatal "The specified puppet.conf #{value} could not be read."

(We should also apply the same change for puppet-path, but that's best tracked in another PR.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made this change.

@@ -31,6 +31,13 @@ def self.command
exit 1
end
end
option nil, :'puppet-conf', 'Path to puppet.conf', argument: :required do |value, cmd|
unless File.readable? value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have validation also defined on the setting itself, so this isn't strictly necessary. If we drop this validation, we get the following:

r10k deploy -c r10k.yaml --puppet-conf not_a_file environment
ERROR    -> Validation failed for 'global' settings group:
    deploy:
        Validation failed for 'deploy' settings group:
            puppet_conf:
                The specified puppet.conf not_a_file is not readable

Is the above error sufficiently clear or are we better served by this more specific error messaging?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to make the error more specific. The check is if the file is readable and the error states it's not readable. Not much else to check or tell the user about.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@treydock I think what @adrienthebo is saying is that we can drop this readable? check altogether because there is validation elsewhere that will produce a similar error message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the validation from this particular location.

@treydock treydock dismissed stale reviews from adrienthebo and mwaggett via 6d2899a April 28, 2020 19:29
@mwaggett
Copy link
Contributor

@treydock Would you mind adding an entry to the CHANGELOG for this? Also looks like we need another rebase/merge-conflict-resolution. 😓

@treydock
Copy link
Contributor Author

@mwaggett I added a changelog entry and rebased against master.

mwaggett
mwaggett previously approved these changes Apr 29, 2020
dhollinger
dhollinger previously approved these changes Nov 8, 2020
Copy link

@dhollinger dhollinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it!

@mwaggett mwaggett dismissed stale reviews from dhollinger and themself via 3a92285 November 10, 2020 17:26
@mwaggett
Copy link
Contributor

This was already approved by @dhollinger but the review got dismissed when I force-pushed to rebase and resolve conflicts in the changelog. so I'm merging even though there is only one recorded review.

@mwaggett mwaggett merged commit abcb30c into puppetlabs:master Nov 10, 2020
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.

5 participants