Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: rickbrouwer <rickbrouwer@gmail.com>
  • Loading branch information
rickbrouwer authored Sep 16, 2024
1 parent f2bc1ba commit 168ce21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/scalers/mssql_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func newMSSQLConnection(meta mssqlMetadata, logger logr.Logger) (*sql.DB, error)
return db, nil
}

func getMSSQLConnectionString(meta mssqlMetadata) string {
func getMSSQLConnectionString(ctx context.Context, meta mssqlMetadata) string {
if meta.ConnectionString != "" {
return meta.ConnectionString
}
Expand All @@ -143,14 +143,14 @@ func getMSSQLConnectionString(meta mssqlMetadata) string {
}

if meta.WorkloadIdentityResource != "" {
token := getOAuthToken(ctx, meta)
token := getOAuthToken(ctx, &meta)

Check failure on line 146 in pkg/scalers/mssql_scaler.go

View workflow job for this annotation

GitHub Actions / Static Checks

cannot use &meta (value of type *mssqlMetadata) as mssqlMetadata value in argument to getOAuthToken

Check failure on line 146 in pkg/scalers/mssql_scaler.go

View workflow job for this annotation

GitHub Actions / Static Checks

cannot use &meta (value of type *mssqlMetadata) as mssqlMetadata value in argument to getOAuthToken
connectionURL.RawQuery += fmt.Sprintf("&access_token=%s", token)
}

return connectionURL.String()
}

func getOAuthToken(meta mssqlMetadata) string {
func getOAuthToken(ctx context.Context, meta mssqlMetadata) string {
if meta.azureOAuth == nil {

Check failure on line 154 in pkg/scalers/mssql_scaler.go

View workflow job for this annotation

GitHub Actions / Static Checks

meta.azureOAuth undefined (type mssqlMetadata has no field or method azureOAuth)

Check failure on line 154 in pkg/scalers/mssql_scaler.go

View workflow job for this annotation

GitHub Actions / Static Checks

meta.azureOAuth undefined (type mssqlMetadata has no field or method azureOAuth)
meta.azureOAuth = azure.NewAzureADWorkloadIdentityTokenProvider(ctx, meta.WorkloadIdentityClientID, meta.WorkloadIdentityTenantID, meta.WorkloadIdentityAuthorityHost, meta.WorkloadIdentityResource)

Check failure on line 155 in pkg/scalers/mssql_scaler.go

View workflow job for this annotation

GitHub Actions / Static Checks

meta.azureOAuth undefined (type mssqlMetadata has no field or method azureOAuth)

Check failure on line 155 in pkg/scalers/mssql_scaler.go

View workflow job for this annotation

GitHub Actions / Static Checks

meta.azureOAuth undefined (type mssqlMetadata has no field or method azureOAuth)
}
Expand Down

0 comments on commit 168ce21

Please sign in to comment.