WIP: Add ability to define custom entries in pg_ident.conf#753
WIP: Add ability to define custom entries in pg_ident.conf#753dineshba wants to merge 1 commit intosorintlab:masterfrom
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.
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.
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.conffile 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"}]}}'