Skip to content

Commit

Permalink
fix: report the real error when newSocketMount() fails (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
hessjcg authored Jan 31, 2023
1 parent 7ccd62a commit d76a334
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ func TestPrometheusMetricsEndpoint(t *testing.T) {
// Keep the test output quiet
c.SilenceUsage = true
c.SilenceErrors = true
c.SetArgs([]string{"--prometheus", "projects/my-project/locations/my-region/clusters/my-cluster/instances/my-instance"})
c.SetArgs([]string{"--prometheus", "projects/my-project/locations/my-region/clusters/my-cluster/instances/my-instance?port=5321"})

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
Expand All @@ -926,7 +926,7 @@ func TestPProfServer(t *testing.T) {
c.SilenceUsage = true
c.SilenceErrors = true
c.SetArgs([]string{"--debug", "--admin-port", "9191",
"projects/proj/locations/region/clusters/clust/instances/inst"})
"projects/proj/locations/region/clusters/clust/instances/inst?port=5323"})
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down
4 changes: 2 additions & 2 deletions internal/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ func NewClient(ctx context.Context, d alloydb.Dialer, l alloydb.Logger, conf *Co
l.Errorf("failed to close mount: %v", mErr)
}
}
i, err := ShortInstURI(inst.Name)
if err != nil {
i, instURIErr := ShortInstURI(inst.Name)
if instURIErr != nil {
// this shouldn't happen because the inst uri is already validated by this point
i = inst.Name
}
Expand Down

0 comments on commit d76a334

Please sign in to comment.