Skip to content

Commit

Permalink
Move to TrimSuffix to metadata parsing section
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo Aravena <[email protected]>
  • Loading branch information
raravena80 authored Jun 15, 2022
1 parent 7dcaff4 commit 54d2a69
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/scalers/azure_pipelines_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ func parseAzurePipelinesMetadata(ctx context.Context, config *ScalerConfig, http
}
}

// Trim any trailing new lines from the Azure Pipelines PAT
meta.personalAccessToken = strings.TrimSuffix(metadata.personalAccessToken, "\n")
meta.scalerIndex = config.ScalerIndex

return &meta, nil
Expand Down Expand Up @@ -179,6 +181,7 @@ func getAzurePipelineRequest(ctx context.Context, url string, metadata *azurePip
}

req.SetBasicAuth("", strings.TrimSuffix(metadata.personalAccessToken, "\n"))
req.SetBasicAuth("", metadata.personalAccessToken)

r, err := httpClient.Do(req)
if err != nil {
Expand Down

0 comments on commit 54d2a69

Please sign in to comment.