Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Trojan295 committed Sep 18, 2024
1 parent 239bcd6 commit 99bba99
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions internal/cloud/gcp/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import (
"golang.org/x/oauth2"
)

type Credentials interface {
GetToken() (string, error)
}
type Client struct {
httpClient *http.Client
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cloud/gcp/gcpauth/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
}
Expand Down

0 comments on commit 99bba99

Please sign in to comment.