Skip to content

Commit

Permalink
use b.Logger()
Browse files Browse the repository at this point in the history
  • Loading branch information
emilymye committed Sep 30, 2019
1 parent e8951d3 commit 69a17de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugin/authorizer_client_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package gcpauth
import (
"context"
"fmt"
"log"
"strings"

log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/sdk/helper/strutil"
"google.golang.org/api/compute/v1"
"google.golang.org/api/iam/v1"
Expand All @@ -17,6 +17,7 @@ var _ client = (*gcpClient)(nil)
// abstracted as an interface for stubbing during testing. See stubbedClient for
// more details.
type gcpClient struct {
logger log.Logger
computeSvc *compute.Service
iamSvc *iam.Service
}
Expand All @@ -33,7 +34,7 @@ func (c *gcpClient) InstanceGroups(ctx context.Context, project string, boundIns
// Some groups returned are regional
// TODO(emilymye, #73): Support regions?
if strings.Contains(k, "/regions/") {
log.Printf("[WARN] ignoring key %q with region in instance group aggregated list", k)
c.logger.Debug("ignoring instance groups under region in instance group aggregated list", "key", k)
continue
}

Expand Down
1 change: 1 addition & 0 deletions plugin/path_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ func (b *GcpAuthBackend) authorizeGCEInstance(ctx context.Context, project strin

return AuthorizeGCE(ctx, &AuthorizeGCEInput{
client: &gcpClient{
logger: b.Logger(),
computeSvc: computeClient,
iamSvc: iamClient,
},
Expand Down

0 comments on commit 69a17de

Please sign in to comment.