Skip to content

Commit

Permalink
fix: fetch command credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
pckhoi committed Nov 13, 2022
1 parent 597a374 commit 4c708e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion cmd/wrgl/fetch/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func Fetch(
logger logr.Logger,
container *pbar.Container,
) error {
client, err := utils.GetAPIClient(cmd, cr.URL)
client, err := cm.GetClient(cmd, cr.URL)
if err != nil {
return fmt.Errorf("error creating new client: %w", err)
}
Expand Down
17 changes: 0 additions & 17 deletions cmd/wrgl/utils/client.go

This file was deleted.

6 changes: 4 additions & 2 deletions cmd/wrgl/utils/clientmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package utils

import (
"fmt"
"net/url"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -42,9 +43,10 @@ func (m *ClientMap) GetClient(cmd *cobra.Command, remoteURI string, opts ...apic
} else if tok != "" {
opts = append(opts, apiclient.WithRelyingPartyToken(tok))
}
client, err = GetAPIClient(cmd, remoteURI, opts...)
logger := GetLogger(cmd)
client, err = apiclient.NewClient(remoteURI, *logger, opts...)
if err != nil {
return nil, err
return nil, fmt.Errorf("error creating new client: %w", err)
}
m.clients[remoteURI] = client
return
Expand Down

0 comments on commit 4c708e8

Please sign in to comment.