Skip to content

Commit

Permalink
FS-1240; Update firmwareinstall active condition http error (#184)
Browse files Browse the repository at this point in the history
* FS-1240; Update firmwareinstall active condition http error from 400 to 409 so it is less vague
  • Loading branch information
jakeschuurmans authored Feb 21, 2024
1 parent 29e20e5 commit 159cd77
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var (
var cmdOrchestrator = &cobra.Command{
Use: "orchestrator",
Short: "Run condition orchestrator service",
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
app, termCh, err := app.New(cmd.Context(), model.AppKindOrchestrator, cfgFile, model.LogLevel(logLevel))
if err != nil {
log.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var shutdownTimeout = 10 * time.Second
var cmdServer = &cobra.Command{
Use: "server",
Short: "Run condition orchestrator API service",
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
app, termCh, err := app.New(cmd.Context(), model.AppKindServer, cfgFile, model.LogLevel(logLevel))
if err != nil {
log.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/v1/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ func TestFirmwareInstall(t *testing.T) {
func() *v1types.ServerResponse {
return &v1types.ServerResponse{
Message: "server has an active condition",
StatusCode: 400,
StatusCode: 409,
}
},
"",
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/v1/routes/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func (r *Routes) firmwareInstall(c *gin.Context) (int, *v1types.ServerResponse)

if err = r.repository.CreateMultiple(otelCtx, serverID, fwCondition, invCondition); err != nil {
if errors.Is(err, store.ErrActiveCondition) {
return http.StatusBadRequest, &v1types.ServerResponse{
return http.StatusConflict, &v1types.ServerResponse{
Message: err.Error(),
}
}
Expand Down

0 comments on commit 159cd77

Please sign in to comment.