Skip to content

Commit

Permalink
GCP Pub Scaler should not panic (kedacore#873)
Browse files Browse the repository at this point in the history
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
  • Loading branch information
zroubalik authored and sstk-tbickford committed Jun 21, 2020
1 parent 0462650 commit 42bfa1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/scalers/gcp_pub_sub_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (s *pubsubScaler) IsActive(ctx context.Context) (bool, error) {
size, err := s.GetSubscriptionSize(ctx)

if err != nil {
gcpPubSubLog.Error(err, "error")
gcpPubSubLog.Error(err, "error getting Active Status")
return false, err
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/scalers/stackdriver_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ func NewStackDriverClient(ctx context.Context, credentials string) (*StackDriver
var gcpCredentials GoogleApplicationCredentials

if err := json.Unmarshal([]byte(credentials), &gcpCredentials); err != nil {
panic(err)
return nil, err
}

clientOption := option.WithCredentialsJSON([]byte(credentials))

client, err := monitoring.NewMetricClient(ctx, clientOption)

if err != nil {
return nil, err
}
Expand Down

0 comments on commit 42bfa1c

Please sign in to comment.