API for adding init containers

This commit is contained in:
Clayton Coleman
2016-03-28 22:13:16 -04:00
parent fee8a55943
commit 6685715c4c
6 changed files with 224 additions and 3 deletions

View File

@@ -131,6 +131,17 @@ func UpdatePodCondition(status *PodStatus, condition *PodCondition) bool {
}
}
// GetPodCondition extracts the provided condition from the given status and returns that.
// Returns nil if the condition is not present.
func GetPodCondition(status PodStatus, t PodConditionType) *PodCondition {
for i, c := range status.Conditions {
if c.Type == t {
return &status.Conditions[i]
}
}
return nil
}
// IsNodeReady returns true if a node is ready; false otherwise.
func IsNodeReady(node *Node) bool {
for _, c := range node.Status.Conditions {