-
Notifications
You must be signed in to change notification settings - Fork 611
Don't use type alias in postgresql_password parameter
#1611
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
Conversation
396aec2 to
6084f19
Compare
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.
We already have defined this as an enum:
| type Postgresql::Pg_password_encryption = Enum['md5', 'scram-sha-256'] |
And it's used in multiple places now, so this would risk them going out of sync. I'd at least expect a comment in both places to remind people to keep them in sync.
9eb7968 to
167412d
Compare
I've added a comment to both files. |
|
Is there a chance you can add a test with |
5609bd0 to
63eebc3
Compare
Sure - i've copied |
|
The previous code in |
|
I can't trigger the CI, maybe because the branch is outdated. Let's try to rebase it… |
6f0cf55 to
7406a21
Compare
|
I needed to approve ci, which I just did |
|
Hello, |
dbb02c3 to
939e909
Compare
|
Hello, |
Is it worth explicitly spelling out that type aliases can't be used in functions if you ever want the function call to be deferred? (Since types aren't plugin-synced to the agent) |
postgresql_password parameter
1fe312d to
0ecebc7
Compare
|
I've rebased/squashed and tidied up the commit message. |
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.
Some small implementation notes, but overall it looks ok.
Type aliases from modules aren't available on the agent. See https://puppet.atlassian.net/browse/PUP-7197 This means that calls to `postgresql::postgresql_password` can't be deferred if the `hash` parameter uses the type `Postgresql::Pg_password_encryption`. Instead we have to use the raw `Enum`, (which unfortunately causes code duplication, but this is unavoidable). Using this function with `Deferred` is not just a theoretical use-case. The module itself tries to here. https://github.com/puppetlabs/puppetlabs-postgresql/blob/20704ffae24dcf970784697b1798c09d026fb7f8/manifests/server/role.pp#L162
0ecebc7 to
e57da89
Compare
Fixed those up. Good to merge? |
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.
My concerns have been addressed.
Summary
This PR fixes 1575
Additional Context
Related Issues (if any)
Checklist
I was hitting 1575 when using a Deferred password. With this fix, puppet creates the database as before (v9.2.0)