Skip to content

Commit

Permalink
Merge pull request #79 from ademariag/fix_scopes_gcp
Browse files Browse the repository at this point in the history
Fix scopes that were not being passed on to the Google provider
  • Loading branch information
bradrydzewski authored Nov 17, 2020
2 parents 89780e6 + 0b0d424 commit cee9b89
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions cmd/drone-autoscaler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ func setupProvider(c config.Config) (autoscaler.Provider, error) {
google.WithServiceAccountEmail(c.Google.ServiceAccountEmail),
google.WithProject(c.Google.Project),
google.WithTags(c.Google.Tags...),
google.WithScopes(c.Google.Scopes...),
google.WithUserData(c.Google.UserData),
google.WithUserDataFile(c.Google.UserDataFile),
google.WithZone(c.Google.Zone),
Expand Down
1 change: 1 addition & 0 deletions drivers/google/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func (p *provider) Create(ctx context.Context, opts autoscaler.InstanceCreateOpt
Size: p.size,
Address: address,
ServiceAccountEmail: p.serviceAccountEmail,
Scopes: p.scopes,
}

logger.
Expand Down
3 changes: 2 additions & 1 deletion provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ type Provider interface {
// An Instance represents a server instance
// (e.g Digital Ocean Droplet).
type Instance struct {
Provider ProviderType
Provider ProviderType
ID string
Name string
Address string
Region string
Image string
Size string
ServiceAccountEmail string
Scopes []string
}

// InstanceCreateOpts define soptional instructions for
Expand Down
2 changes: 1 addition & 1 deletion server/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func TestWriteJSON(t *testing.T) {
if got, want := w.Body.String(), "{\"hello\":\"world\"}\n"; got != want {
t.Errorf("Want JSON body %q, got %q", want, got)
}
if got, want := w.HeaderMap.Get("Content-Type"), "application/json"; got != want {
if got, want := w.HeaderMap.Get("Content-Type"), "application/json; charset=utf-8"; got != want {
t.Errorf("Want Content-Type %q, got %q", want, got)
}
if got, want := w.Code, http.StatusTeapot; got != want {
Expand Down

0 comments on commit cee9b89

Please sign in to comment.