-
Notifications
You must be signed in to change notification settings - Fork 448
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
WIP: Add ability to define custom entries in pg_ident.conf #753
base: master
Are you sure you want to change the base?
Conversation
@dineshba Thanks for the PR!
|
Hi @sgotti It is better to add some integration tests. So I will add So, it is not ready for review. I will mark the PR as WIP. |
if _, err := f.Write([]byte("# MAPNAME\tSYSTEM-USERNAME\tPG-USERNAME" + "\n")); err != nil { | ||
return err | ||
} | ||
for key, value := range p.ident { |
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.
Entries will likely be written out in an undefined order (https://go.dev/blog/maps#iteration-order) - sorting the entries before writing them out might be beneficial
} | ||
for key, value := range p.ident { | ||
for _, v := range value { | ||
if _, err := f.Write([]byte(fmt.Sprintf("%s\t%s\t%s", key, v.SystemUsername, v.DBUsername) + "\n")); err != nil { |
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.
f
is an os.File
which doesn't guarantee full writes
I found that attempting to replace an entry for one of the ident maps fails due to
(where Overall I think structuring the |
Trying to fix #633
Tasks:
pg_ident.conf
file whenever there is a change in pg_ident in clusterSpecHow to use in clusterSpec:
stolonctl update -p '{"pgIdent": {"omicron": [{"systemUsername": "bryanh", "databaseUsername": "bryanh"}, {"systemUsername": "robert", "databaseUsername": "bob"}]}}'