feature: Added command to list pods managed by fission for environment/function (#2207)

This commit is contained in:
Pradeep Lakshmi Narasimha
2021-10-10 10:52:42 +05:30
committed by GitHub
parent e930a2922c
commit c9da527d37
16 changed files with 403 additions and 32 deletions
-28
View File
@@ -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()