Skip to content

Commit

Permalink
chore: return empty life for invalid db id
Browse files Browse the repository at this point in the history
  • Loading branch information
wallyworld committed Sep 17, 2024
1 parent a922128 commit 642d9e7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apiserver/facades/agent/uniter/uniter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ func (u *UniterAPI) RelationsStatus(ctx context.Context, args params.Entities) (
return result, nil
}

// Life returns the life status of the specified units.
// Life returns the life status of the specified applications or units.
func (u *UniterAPI) Life(ctx context.Context, args params.Entities) (params.LifeResults, error) {
result := params.LifeResults{
Results: make([]params.LifeResult, len(args.Entities)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,6 @@ func (a *API) UpdateApplicationsUnits(ctx context.Context, args params.UpdateApp
result.Results[i].Error = apiservererrors.ServerError(err)
continue
}
//
app, err := a.state.Application(appTag.Id())
if err != nil {
result.Results[i].Error = apiservererrors.ServerError(err)
Expand Down
2 changes: 1 addition & 1 deletion apiserver/facades/controller/caasfirewaller/firewaller.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func NewFacade(
}, nil
}

// Life returns the life status of the specified units.
// Life returns the life status of the specified applications or units.
func (f *Facade) Life(ctx context.Context, args params.Entities) (params.LifeResults, error) {
result := params.LifeResults{
Results: make([]params.LifeResult, len(args.Entities)),
Expand Down
4 changes: 2 additions & 2 deletions apiserver/facades/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8204,7 +8204,7 @@
"$ref": "#/definitions/LifeResults"
}
},
"description": "Life returns the life status of the specified units."
"description": "Life returns the life status of the specified applications or units."
},
"Watch": {
"type": "object",
Expand Down Expand Up @@ -39658,7 +39658,7 @@
"$ref": "#/definitions/LifeResults"
}
},
"description": "Life returns the life status of the specified units."
"description": "Life returns the life status of the specified applications or units."
},
"LogActionsMessages": {
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion domain/life/life.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ func (l Life) Value() corelife.Value {
case Dead:
return corelife.Dead
}
return corelife.Alive
return ""
}

0 comments on commit 642d9e7

Please sign in to comment.