Skip to content

Commit

Permalink
Merge 37fa1bf into ccd57b8
Browse files Browse the repository at this point in the history
  • Loading branch information
lubien authored Feb 19, 2025
2 parents ccd57b8 + 37fa1bf commit fb67805
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion internal/uiex/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (

"github.com/superfly/fly-go"
"github.com/superfly/fly-go/tokens"
"github.com/superfly/flyctl/internal/httptracing"
"github.com/superfly/flyctl/internal/logger"
)

type Client struct {
Expand Down Expand Up @@ -46,7 +48,7 @@ func NewWithOptions(ctx context.Context, opts NewClientOpts) (*Client, error) {
return nil, fmt.Errorf("invalid FLY_UIEX_BASE_URL '%s' with error: %w", uiexBaseURL, err)
}

httpClient, err := fly.NewHTTPClient(opts.Logger, http.DefaultTransport)
httpClient, err := fly.NewHTTPClient(logger.MaybeFromContext(ctx), httptracing.NewTransport(http.DefaultTransport))
if err != nil {
return nil, fmt.Errorf("uiex: can't setup HTTP client to %s: %w", uiexUrl.String(), err)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/uiex/managed_postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (c *Client) ListManagedClusters(ctx context.Context, orgSlug string) (ListM
req.Header.Add("Authorization", "Bearer "+cfg.Tokens.GraphQL())
req.Header.Add("Content-Type", "application/json")

res, err := http.DefaultClient.Do(req)
res, err := c.httpClient.Do(req)
if err != nil {
return response, err
}
Expand Down Expand Up @@ -84,7 +84,7 @@ func (c *Client) GetManagedCluster(ctx context.Context, orgSlug string, id strin
req.Header.Add("Authorization", "Bearer "+cfg.Tokens.GraphQL())
req.Header.Add("Content-Type", "application/json")

res, err := http.DefaultClient.Do(req)
res, err := c.httpClient.Do(req)
if err != nil {
return response, err
}
Expand Down

0 comments on commit fb67805

Please sign in to comment.