Skip to content

Commit

Permalink
delete git auth secret when app creation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Davor Gajic committed Dec 6, 2023
1 parent 2135486 commit c94a012
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions create/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ func (app *applicationCmd) Run(ctx context.Context, client *api.Client) error {
defer cancel()

if err := c.createResource(appWaitCtx); err != nil {
if auth.Enabled() {
secret := auth.Secret(newApp)
if gitErr := client.Delete(ctx, secret); err != nil {
return errors.New(err.Error() + fmt.Errorf("unable to delete git auth secret, please contact support: %w", gitErr).Error())
}
}

return err
}

Expand Down

0 comments on commit c94a012

Please sign in to comment.