mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
improve GetExistingContainerStatus
remove duplicate Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
This commit is contained in:
parent
09ccecfe9c
commit
9770ff9082
@ -205,14 +205,10 @@ func GetContainerStatus(statuses []v1.ContainerStatus, name string) (v1.Containe
|
||||
}
|
||||
|
||||
// GetExistingContainerStatus extracts the status of container "name" from "statuses",
|
||||
// and returns empty status if "name" does not exist.
|
||||
// It also returns if "name" exists.
|
||||
func GetExistingContainerStatus(statuses []v1.ContainerStatus, name string) v1.ContainerStatus {
|
||||
for i := range statuses {
|
||||
if statuses[i].Name == name {
|
||||
return statuses[i]
|
||||
}
|
||||
}
|
||||
return v1.ContainerStatus{}
|
||||
status, _ := GetContainerStatus(statuses, name)
|
||||
return status
|
||||
}
|
||||
|
||||
// IsPodAvailable returns true if a pod is available; false otherwise.
|
||||
|
Loading…
Reference in New Issue
Block a user