Skip to content

Commit

Permalink
fix(region): set container probe_failed status when exited (#21081)
Browse files Browse the repository at this point in the history
  • Loading branch information
zexi authored Aug 23, 2024
1 parent ac05ef7 commit 4e7b966
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/compute/models/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,3 +678,12 @@ func (c *SContainer) GetReleasedDevices(ctx context.Context, userCred mcclient.T
}
return out, nil
}

func (c *SContainer) PerformStatus(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformStatusInput) (jsonutils.JSONObject, error) {
if c.GetStatus() == api.CONTAINER_STATUS_EXITED {
if input.Status == api.CONTAINER_STATUS_PROBE_FAILED {
return nil, httperrors.NewInputParameterError("can't set container status to %s when %s", input.Status, c.Status)
}
}
return c.SVirtualResourceBase.PerformStatus(ctx, userCred, query, input)
}

0 comments on commit 4e7b966

Please sign in to comment.