Skip to content

Commit

Permalink
fix: don't return a conflict when redeploying an identical deployment (
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas authored Oct 13, 2023
1 parent e689666 commit 0f74f98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,11 @@ func (s *Service) ReplaceDeploy(ctx context.Context, c *connect.Request[ftlv1.Re
logger.Errorf(err, "Deployment not found: %s", newDeploymentName)
return nil, connect.NewError(connect.CodeNotFound, errors.New("deployment not found"))
} else if errors.Is(err, dal.ErrConflict) {
logger.Errorf(err, "Deployment already exists: %s", newDeploymentName)
return nil, connect.NewError(connect.CodeAlreadyExists, errors.WithStack(err))
logger.Infof("Deployment already exists: %s", newDeploymentName)
} else {
logger.Errorf(err, "Could not replace deployment: %s", newDeploymentName)
return nil, errors.Wrap(err, "could not replace deployment")
}
logger.Errorf(err, "Could not replace deployment: %s", newDeploymentName)
return nil, errors.Wrap(err, "could not replace deployment")
}
return connect.NewResponse(&ftlv1.ReplaceDeployResponse{}), nil
}
Expand Down

0 comments on commit 0f74f98

Please sign in to comment.