Skip to content

Commit

Permalink
Add handle services empty
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhtc1202 committed May 27, 2021
1 parent ccbdb11 commit 4b5761b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/app/piped/cloudprovider/ecs/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ func (c *client) GetPrimaryTaskSet(ctx context.Context, service types.Service) (
if err != nil {
return nil, fmt.Errorf("failed to get primary task set of service %s: %w", *service.ServiceName, err)
}
if len(output.Services) == 0 {
return nil, fmt.Errorf("failed to get primary task set of service %s: services not found", *service.ServiceName)
}
taskSets := output.Services[0].TaskSets
for _, taskSet := range taskSets {
if aws.ToString(taskSet.Status) == "PRIMARY" {
Expand Down

0 comments on commit 4b5761b

Please sign in to comment.