-
Notifications
You must be signed in to change notification settings - Fork 13
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 show user command #83
Conversation
6a5e8fa
to
49ef5e5
Compare
It doesn't look like the command works when I set the user through the spec:
|
What are you seeing? If I set two users in the spec, one with the
then the
And then if I ask for the connection info, I get the databases[0] listed, as per the secret:
|
The |
2ad3ce8
to
04211be
Compare
@@ -87,7 +92,7 @@ HA | |||
|
|||
// Print the pgbackrest info output received. | |||
cmd.Printf("BACKUP\n\n") | |||
if stdout, stderr, err := showBackup(config, args, "text", ""); err != nil { | |||
if stdout, stderr, err := getBackup(config, args, "text", ""); 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.
⛏️ Not a blocker, but I'd like function renames unrelated to the current feature to be in a separate commit (same for getHA
as well).
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.
Pushed new commits to separate that.
internal/cmd/show.go
Outdated
} | ||
|
||
// Set up a tabwriter that writes to stdout, with | ||
|
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.
⛏️ extra newline
internal/cmd/show.go
Outdated
" user=" + string(secret.Data["user"]) + | ||
" password=" + string(secret.Data["password"])) | ||
cmd.Println("Connection URL:") | ||
cmd.Println(" postgres://" + string(secret.Data["password"]) + |
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.
❓ Should we have a user
value here? For a cluster named hippo
(and based on this example ), I'd expect something like
Connection URL:
postgres://user:[email protected]:5432/hippo
So the code might be
cmd.Println(" postgres://" + string(secret.Data["user"]) + ":" + string(secret.Data["password"]) +
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.
Ooh, good catch
Adds a command to show the contents of the pguser Secrets. Issue: PGO-470
- Replace 'containsString' function with slices.Contains. - Move 'confirm' function to util package.
7e930f7
to
d57bd86
Compare
d57bd86
to
070d6a9
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.
👍 Updates look good to me.
Adds a command to show the contents of the pguser Secrets.
Issue: PGO-470