-
Notifications
You must be signed in to change notification settings - Fork 12
PMM-4743 Allow to pass password individually. #71
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #71 +/- ##
==========================================
- Coverage 23.72% 23.52% -0.20%
==========================================
Files 45 45
Lines 2778 2805 +27
==========================================
+ Hits 659 660 +1
- Misses 2095 2120 +25
- Partials 24 25 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -154,9 +154,10 @@ func (e errFromNginx) GoString() string { | |||
} | |||
|
|||
// SetupClients configures local and PMM Server API clients. | |||
func SetupClients(ctx context.Context, serverURL string) { | |||
func SetupClients(ctx context.Context, serverURL, serverUsername, serverPassword string, serverInsecureTLS bool) { |
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.
[golangci-lint] reported by reviewdog 🐶
Function 'SetupClients' is too long (93 > 60) (funlen)
@@ -189,6 +190,29 @@ func SetupClients(ctx context.Context, serverURL string) { | |||
} | |||
} | |||
|
|||
// override username, password, insecure-tls if given | |||
if serverUsername != "" || serverPassword != "" { |
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.
[golangci-lint] reported by reviewdog 🐶
if serverUsername != "" || serverPassword != ""
is deeply nested (complexity: 5) (nestif)
newUsername = GlobalFlags.ServerURL.User.Username() | ||
newPassword, _ = GlobalFlags.ServerURL.User.Password() | ||
} | ||
if serverUsername != "" { |
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.
[golangci-lint] reported by reviewdog 🐶
if statements should only be cuddled with assignments (wsl)
if serverUsername != "" { | ||
newUsername = serverUsername | ||
} | ||
if serverPassword != "" { |
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.
[golangci-lint] reported by reviewdog 🐶
if statements should only be cuddled with assignments (wsl)
No description provided.