Skip to content

Commit 39801d6

Browse files
kbukum1Copilot
andcommitted
Fix gofmt trailing newline and align GCP IAM expiry check with cache buffer
- Remove trailing blank line in oidc_credential.go (gofmt failure) - Change GCP IAM minimum-remaining check from 1 minute to 5 minutes to match the 5-minute early-refresh buffer in GetOrRefreshOIDCToken, preventing unnecessary STS/IAM calls for short-lived tokens Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a2880d7 commit 39801d6

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

internal/oidc/actions_oidc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ func GetGCPAccessToken(ctx context.Context, params GCPOIDCParameters, githubToke
797797
}
798798

799799
remaining := time.Until(expireTime)
800-
if remaining < 1*time.Minute {
800+
if remaining < 5*time.Minute {
801801
return nil, fmt.Errorf("GCP IAM token expires too soon (%v remaining, service-account: %s)", remaining, params.ServiceAccount)
802802
}
803803

internal/oidc/oidc_credential.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,3 @@ func GetOrRefreshOIDCToken(cred *OIDCCredential, ctx context.Context) (string, e
224224

225225
return oidcAccessToken.Token, nil
226226
}
227-

0 commit comments

Comments
 (0)