Skip to content

Commit 493dda5

Browse files
committed
add useful coderabbit changes
1 parent 1e1ef47 commit 493dda5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libs/storage/azure_plan_storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func (psa *PlanStorageAzure) PlanExists(artifactName string, storedPlanFilePath
2525
blobClient := psa.ServiceClient.ServiceClient().NewContainerClient(psa.ContainerName).NewBlobClient(storedPlanFilePath)
2626

2727
// Get the blob properties
28-
resp, err := blobClient.GetProperties(context.TODO(), nil)
28+
resp, err := blobClient.GetProperties(psa.Context, nil)
2929
if err != nil {
3030
slog.Error("Failed to get blob properties",
3131
"container", psa.ContainerName,

libs/storage/plan_storage.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ func NewPlanStorage(ghToken string, ghRepoOwner string, ghRepositoryName string,
399399
slog.Error("PLAN_UPLOAD_AZURE_STORAGE_CONTAINER_NAME not defined for Azure plan storage")
400400
return nil, fmt.Errorf("PLAN_UPLOAD_AZURE_STORAGE_CONTAINER_NAME is not defined")
401401
}
402-
sa_name := strings.ToLower(os.Getenv("PLAN_UPLOAD_AZURE_STORAGE_ACCOUNT_NAME"))
403-
if sa_name == "" {
402+
accountName := strings.ToLower(os.Getenv("PLAN_UPLOAD_AZURE_STORAGE_ACCOUNT_NAME"))
403+
if accountName == "" {
404404
slog.Error("PLAN_UPLOAD_AZURE_STORAGE_ACCOUNT_NAME not defined for Azure plan storage")
405405
return nil, fmt.Errorf("PLAN_UPLOAD_AZURE_STORAGE_ACCOUNT_NAME is not defined")
406406
}
@@ -411,7 +411,7 @@ func NewPlanStorage(ghToken string, ghRepoOwner string, ghRepositoryName string,
411411
return nil, fmt.Errorf("failed to create Azure credential: %v", err)
412412
}
413413
client, err := azblob.NewClient(
414-
fmt.Sprintf("https://%s.blob.core.windows.net", sa_name),
414+
fmt.Sprintf("https://%s.blob.core.windows.net", accountName),
415415
cred,
416416
nil,
417417
)

0 commit comments

Comments
 (0)