Skip to content

Commit

Permalink
Fix issues with CII client (#1309)
Browse files Browse the repository at this point in the history
Co-authored-by: Azeem Shaikh <azeems@google.com>
  • Loading branch information
azeemshaikh38 and azeemsgoogle committed Nov 19, 2021
1 parent 08a7876 commit 5025299
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions clients/cii_blob_client.go
Expand Up @@ -39,6 +39,15 @@ func (client *blobClientCIIBestPractices) GetBadgeLevel(ctx context.Context, uri
defer bucket.Close()

objectName := fmt.Sprintf("%s/result.json", uri)

exists, err := bucket.Exists(ctx, objectName)
if err != nil {
return Unknown, fmt.Errorf("error during bucket.Exists: %w", err)
}
if !exists {
return NotFound, nil
}

jsonData, err := bucket.ReadAll(ctx, objectName)
if err != nil {
return Unknown, fmt.Errorf("error during bucket.ReadAll: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion cron/k8s/cii.yaml
Expand Up @@ -18,7 +18,7 @@ metadata:
name: scorecard-cii-worker
spec:
# At 00:00UTC on 1st of every month.
schedule: "@monthly"
schedule: "0 20 * * 0"
concurrencyPolicy: "Forbid"
jobTemplate:
spec:
Expand Down

0 comments on commit 5025299

Please sign in to comment.