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 47c681d
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.Join(err, fmt.Errorf("unable to delete git auth secret, please contact support: %w", gitErr))

Check failure on line 126 in create/application.go

View workflow job for this annotation

GitHub Actions / test

undefined: errors.Join

Check failure on line 126 in create/application.go

View workflow job for this annotation

GitHub Actions / lint

undefined: errors.Join

Check failure on line 126 in create/application.go

View workflow job for this annotation

GitHub Actions / lint

undefined: errors.Join
}
}

return err
}

Expand Down

0 comments on commit 47c681d

Please sign in to comment.