fix: setup (#1515)

* fix: setup uniqueness

* fix: setup step done
This commit is contained in:
Fabi 2021-04-01 10:14:07 +02:00 committed by GitHub
parent d1284082a1
commit 800eeca7ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -93,6 +93,9 @@ func (c *Commands) setup(ctx context.Context, step Step, iamAggregateProvider fu
events = append(events, iam_repo.NewSetupStepDoneEvent(ctx, iamAgg, step.Step()))
_, err = c.eventstore.PushEvents(ctx, events...)
if caos_errs.IsErrorAlreadyExists(err) {
logging.LogWithFields("SETUP-4M9gsf", "step", step.Step()).WithError(err).Info("setup step already done")
}
if err != nil {
return caos_errs.ThrowPreconditionFailedf(nil, "EVENT-dbG31", "Setup %v failed", step.Step())
}

View File

@ -82,6 +82,7 @@ func NewSetupStepDoneEvent(
SetupDoneEventType,
),
Step: step,
Done: true,
}
}