From 99bba998d7dbd00f011130d989a12c7a8ab1f750 Mon Sep 17 00:00:00 2001 From: Damian Czaja Date: Wed, 18 Sep 2024 17:59:38 +0200 Subject: [PATCH] cleanup --- cmd/proxy/main.go | 4 ++-- internal/cloud/gcp/executor.go | 3 --- internal/cloud/gcp/gcpauth/client.go | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/cmd/proxy/main.go b/cmd/proxy/main.go index 5b55fb5..233b6ec 100644 --- a/cmd/proxy/main.go +++ b/cmd/proxy/main.go @@ -34,7 +34,7 @@ func main() { ctx := context.Background() - credsSource, err := gcpauth.NewCredentialsSource(ctx) + tokenSource, err := gcpauth.NewTokenSource(ctx) if err != nil { logger.WithError(err).Panicf("Failed to create GCP credentials source") } @@ -78,7 +78,7 @@ func main() { } }(conn) - client := proxy.New(conn, gcp.New(credsSource), logger, + client := proxy.New(conn, gcp.New(tokenSource), logger, cfg.ClusterID, GetVersion(), cfg.KeepAlive, cfg.KeepAliveTimeout) go startHealthServer(logger, cfg.HealthAddress) diff --git a/internal/cloud/gcp/executor.go b/internal/cloud/gcp/executor.go index b7a6a76..e61b1d4 100644 --- a/internal/cloud/gcp/executor.go +++ b/internal/cloud/gcp/executor.go @@ -9,9 +9,6 @@ import ( "golang.org/x/oauth2" ) -type Credentials interface { - GetToken() (string, error) -} type Client struct { httpClient *http.Client } diff --git a/internal/cloud/gcp/gcpauth/client.go b/internal/cloud/gcp/gcpauth/client.go index 105944d..92fda52 100644 --- a/internal/cloud/gcp/gcpauth/client.go +++ b/internal/cloud/gcp/gcpauth/client.go @@ -7,7 +7,7 @@ import ( "golang.org/x/oauth2/google" ) -func NewCredentialsSource(ctx context.Context, scopes ...string) (oauth2.TokenSource, error) { +func NewTokenSource(ctx context.Context, scopes ...string) (oauth2.TokenSource, error) { if len(scopes) == 0 { scopes = []string{"https://www.googleapis.com/auth/cloud-platform"} }