feature: Added command to list pods managed by fission for environment/function (#2207)
This commit is contained in:
@@ -58,34 +58,6 @@ func GetFunctionIstioServiceName(fnName, fnNamespace string) string {
|
||||
return fmt.Sprintf("istio-%v-%v", fnName, fnNamespace)
|
||||
}
|
||||
|
||||
// IsReadyPod checks both all containers in a pod are ready and whether
|
||||
// the .metadata.DeletionTimestamp is nil.
|
||||
func IsReadyPod(pod *apiv1.Pod) bool {
|
||||
// since its a utility function, just ensuring there is no nil pointer exception
|
||||
if pod == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
// pod is in "Terminating" status if deletionTimestamp is not nil
|
||||
// https://github.com/kubernetes/kubernetes/issues/61376
|
||||
if pod.ObjectMeta.DeletionTimestamp != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
// pod does not have an IP address allocated to it yet
|
||||
if pod.Status.PodIP == "" {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, cStatus := range pod.Status.ContainerStatuses {
|
||||
if !cStatus.Ready {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// GetTempDir creates and return a temporary directory
|
||||
func GetTempDir() (string, error) {
|
||||
id, err := uuid.NewV4()
|
||||
|
||||
Reference in New Issue
Block a user