-
Notifications
You must be signed in to change notification settings - Fork 212
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
feat: Add postgresql_security_label
resource
#482
Conversation
14b7748
to
ad70419
Compare
@cyrilgdn can you please take a look? Thanks. |
25db301
to
ab06076
Compare
I tried to get the communication going in the original PR #365 but didn't see @jbunting responding, hence this PR. Saying that however, this PR is based on and cherry-picked from the work @jbunting did in #365, so we are co-authored for this PR effectively.
Cool, I have removed that change from this PR, please take a look. Thanks. |
Sorry I haven't really had time to get back to this. I'm happy to change my pr to let you edit it (how?), or just close it out, whatever is easier. |
I'd suggest we close the previous one #365 and just use this one since the work is mostly done already. |
ab06076
to
ca97be0
Compare
@cyrilgdn can you please make it to the main if no issues found? Thanks. The branch quickly turns out of data, I clicked on rebase which requires the checks to run again. |
I started the review yesterday but it takes time and I have a job too 😅 , so please be patient 🙏 |
thank you, guys, for your work and commitment. |
Even as powerful as @cyrilgdn, you still need a job, I don't believe it, must be a lie 😅 |
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 for your work 💪 , some minor comments/questions but otherwise 👍
row := db.QueryRow(query, objectType, quoteIdentifier(objectName), quoteIdentifier(provider)) | ||
|
||
var label string | ||
err = row.Scan(&objectType, &provider, &label) |
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.
Is there a point to scan objectType
and provider
as you use them in the filters of the request?
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.
This is Read function right, I believe the point of the Read function in Terraform providers is to re-conciliate the state values with the actual value in the remote system, so yes, it's good to read and update the local.
I didn't include the objname
in the scan because of the difficulties involved with handling the quote_ident
, I probably should still do that, will push new commit to change this.
5d30436
to
4f1956f
Compare
Thanks @cyrilgdn for the review, have updated with the below, please take a look, thanks.
|
actually it's related, cf #482 (comment) |
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.
Don't bother with the failing test on version 11, I was planning to remove this version from the tests as it's not supported by Postgres anymore.
Adding quote to identifiers that doesn't have special characters is a no-op operation, PostgreSQL will remove the quote before persistence, for example "test_role" is saved as |
Thanks, it's clear 👍 Weird behavior from Postgres side though as it does not behave similarly for other resources but it's cool you handle it properly! |
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.
@cyrilgdn any chance you could trigger a release when you have a moment? |
@cyrilgdn - Nice, if you could make a release of this change, so I can avoid forking it out just to be able to use in my project :) |
Seems it didn't get to last release on 22 Oct. Is there any plan for next one, any eta? Thanks |
@stanleyz @jarpoole @binnykmathew-tlnr @martindz This has just been release in https://github.com/cyrilgdn/terraform-provider-postgresql/releases/tag/v1.25.0 |
This PR is based on the great job @jbunting did in #365, which fixed the quoted identifier for object name and provider in the
pg_seclabels
table.Additional changes: