Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Trojan295 committed Sep 23, 2024
1 parent 315cc9c commit 0ea1e47
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 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,13 +78,13 @@ func main() {
}
}(conn)

client := proxy.New(conn, gcp.New(credsSource), logger,
client := proxy.New(conn, gcp.New(tokenSource), logger,
cfg.GetPodName(), cfg.ClusterID, GetVersion(), cfg.KeepAlive, cfg.KeepAliveTimeout)

go startHealthServer(logger, cfg.HealthAddress)

proxyCtx := metadata.NewOutgoingContext(ctx, metadata.Pairs(
"authorization", fmt.Sprintf("Token %s", cfg.CastAI.ApiKey),
"authorization", fmt.Sprintf("Token %s", cfg.CastAI.APIKey),
))

err = client.Run(proxyCtx)
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 0ea1e47

Please sign in to comment.