mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-07-24 00:52:45 +00:00
Fixed API changes based on new dependencies
The "github.com/google/go-github/v87/github" has API shape changes, therefore a mere go.mod dependency update was inadequate; this PR adds necessary changes for feature parity and tests. Co-authored-by: Ryan Richard <richardry@vmware.com> Signed-off-by: Volkan Özçelik <volkan.ozcelik@broadcom.com>
This commit is contained in:
committed by
Ryan Richard
co-authored by
Ryan Richard
parent
1ccfd13194
commit
d14722396a
@@ -71,8 +71,18 @@ func NewGitHubClient(httpClient *http.Client, apiBaseURL, token string) (GitHubI
|
||||
return nil, fmt.Errorf("%s: token cannot be empty string", errorPrefix)
|
||||
}
|
||||
|
||||
client := github.NewClient(httpClient).WithAuthToken(token)
|
||||
client.BaseURL = parsedURL
|
||||
// go-github's WithEnterpriseURLs requires a non-empty upload URL even though
|
||||
// Pinniped only calls read endpoints (Users.Get, Organizations.List,
|
||||
// Teams.ListUserTeams), all of which use the base URL. The upload URL is never
|
||||
// exercised today. It should be updated if an upload-style call is ever used.
|
||||
client, err := github.NewClient(
|
||||
github.WithHTTPClient(httpClient),
|
||||
github.WithAuthToken(token),
|
||||
github.WithEnterpriseURLs(parsedURL.String(), parsedURL.String()),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%s: %w", errorPrefix, err)
|
||||
}
|
||||
|
||||
return &githubClient{
|
||||
client: client,
|
||||
|
||||
Reference in New Issue
Block a user