Skip to content

Commit

Permalink
b/312963270 Ignore VPC-SC inaccessible projects (#16)
Browse files Browse the repository at this point in the history
When encountering a project that's inacessible because of
VPC SC policies, emit a warning and continue with other
projects.
  • Loading branch information
jpassing committed Nov 23, 2023
1 parent fa4c94a commit 02127c1
Showing 1 changed file with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,26 @@ await instances.ConfigureAwait(false),
await nodes.ConfigureAwait(false),
await disks.ConfigureAwait(false),
projectId);

//
// Query logs to replay history.
//
// NB. We could query mutliple projects at once, but the API
// quickly becomes unreliable (read: throws random 500 errors)
// when doing so. Therefore, we're conservative and only query
// one project at a time.
//
await this.auditLogAdapter
.ProcessInstanceEventsAsync(
new[] { projectId },
builder.StartDate,
builder,
cancellationToken)
.ConfigureAwait(false);

this.logger.LogInformation(
"Finished analyzing placement history for project {project}...",
projectId);
}
catch (ResourceAccessDeniedException e)
{
Expand All @@ -157,26 +177,6 @@ await disks.ConfigureAwait(false),
projectId,
e.FullMessage());
}

//
// Query logs to replay history.
//
// NB. We could query mutliple projects at once, but the API
// quickly becomes unreliable (read: throws random 500 errors)
// when doing so. Therefore, we're conservative and only query
// one project at a time.
//
await this.auditLogAdapter
.ProcessInstanceEventsAsync(
new[] { projectId },
builder.StartDate,
builder,
cancellationToken)
.ConfigureAwait(false);

this.logger.LogInformation(
"Finished analyzing placement history for project {project}...",
projectId);
}

return builder.Build();
Expand Down

0 comments on commit 02127c1

Please sign in to comment.