Skip to content

Commit

Permalink
Increased sa and secret creation_time difference check (#1)
Browse files Browse the repository at this point in the history
Increased service_account and secret creation_time difference check to a bigger limit, 60 seconds; instead of 3 seconds. If we have mutation webhooks, the secret creation can take longer.
hashicorp#1104
  • Loading branch information
amsgeodis authored Feb 11, 2021
1 parent 1a5d859 commit 68037bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kubernetes/resource_kubernetes_service_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func findDefaultServiceAccount(ctx context.Context, sa *api.ServiceAccount, conn
continue
}

if secret.CreationTimestamp.Sub(sa.CreationTimestamp.Time) > (3 * time.Second) {
if secret.CreationTimestamp.Sub(sa.CreationTimestamp.Time) > (60 * time.Second) {
log.Printf("[DEBUG] Skipping %s as it wasn't created at the same time as the service account", saSecret.Name)
continue
}
Expand Down

0 comments on commit 68037bb

Please sign in to comment.