func IsContainerReady(pod *core.Pod, container string) bool {
	condition := getPodCondition(&pod.Status, core.PodReady)
	if condition == nil {
		return false
	}
	if condition.Status == core.ConditionTrue {
		return true
	}
	if !IsContainerRunning(pod, container) {
		return false
	}
	switch condition.Reason {
	case ServerContainerConditionContainersNotReady:
		if strings.HasPrefix(condition.Message, ServerContainerConditionPrefix) {
			n := strings.TrimPrefix(condition.Message, ServerContainerConditionPrefix)
			return !strings.Contains(n, container)
		}
		return false
	default:
		return false
	}
}
IsContainerReady returns true if the PodReady condition on
the given pod is set to true.
package k8sutil
import (
	"context"
	"fmt"
	"path/filepath"
	"strings"
	"time"
	"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod"
	"github.com/arangodb/kube-arangodb/pkg/util"
	"github.com/arangodb/kube-arangodb/pkg/util/errors"
	"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces"
	"k8s.io/apimachinery/pkg/types"
	"k8s.io/apimachinery/pkg/util/json"
	"k8s.io/apimachinery/pkg/api/resource"
	core "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
	ServerContainerName             = "server"
	ExporterContainerName           = "exporter"
	ArangodVolumeName               = "arangod-data"
	TlsKeyfileVolumeName            = "tls-keyfile"
	ClientAuthCAVolumeName          = "client-auth-ca"
	ClusterJWTSecretVolumeName      = "cluster-jwt"
	MasterJWTSecretVolumeName       = "master-jwt"
	LifecycleVolumeName             = "lifecycle"
	FoxxAppEphemeralVolumeName      = "ephemeral-apps"
	TMPEphemeralVolumeName          = "ephemeral-tmp"
	RocksdbEncryptionVolumeName     = "rocksdb-encryption"
	ExporterJWTVolumeName           = "exporter-jwt"
	ArangodVolumeMountDir           = "/data"
	RocksDBEncryptionVolumeMountDir = "/secrets/rocksdb/encryption"
	TLSKeyfileVolumeMountDir        = "/secrets/tls"
	TLSSNIKeyfileVolumeMountDir     = "/secrets/sni"
	ClientAuthCAVolumeMountDir      = "/secrets/client-auth/ca"
	ClusterJWTSecretVolumeMountDir  = "/secrets/cluster/jwt"
	ExporterJWTVolumeMountDir       = "/secrets/exporter/jwt"
	MasterJWTSecretVolumeMountDir   = "/secrets/master/jwt"
	ServerContainerConditionContainersNotReady = "ContainersNotReady"
	ServerContainerConditionPrefix             = "containers with unready status: "
)
func GetAnyVolumeByName(volumes []core.Volume, name string) (core.Volume, bool) {
	for _, c := range volumes {
		if c.Name == name {
			return c, true
		}
	}
	return core.Volume{}, false
}
func GetAnyVolumeMountByName(volumes []core.VolumeMount, name string) (core.VolumeMount, bool) {
	for _, c := range volumes {
		if c.Name == name {
			return c, true
		}
	}
	return core.VolumeMount{}, false
}
func IsPodReady(pod *core.Pod) bool {
	condition := getPodCondition(&pod.Status, core.PodReady)
	return condition != nil && condition.Status == core.ConditionTrue
}