func IsPodCompleted(pod *v1.Pod) bool {
	return pod.Status.Phase == v1.PodSucceeded || pod.Status.Phase == v1.PodFailed
}
IsPodCompleted returns true for Pods that are Pending or Running.
package k8s
import (
	"context"
	"fmt"
	"time"
	log "github.com/sirupsen/logrus"
	"github.com/uswitch/kiam/pkg/aws/sts"
	v1 "k8s.io/api/core/v1"
	"k8s.io/client-go/tools/cache"
)
type PodCache struct {
	pods       chan *v1.Pod
	indexer    cache.Indexer
	controller cache.Controller
}
func NewPodCache(arnResolver sts.ARNResolver, source cache.ListerWatcher, syncInterval time.Duration, bufferSize int) *PodCache {
	indexers := cache.Indexers{
		indexPodIP:           podIPIndex,
		indexPodRoleIdentity: podRoleIdentityIndex(arnResolver),
	}
	pods := make(chan *v1.Pod, bufferSize)
	podHandler := &podHandler{pods}
	indexer, controller := cache.NewIndexerInformer(source, &v1.Pod{}, syncInterval, podHandler, indexers)
	podCache := &PodCache{
		pods:       pods,
		indexer:    indexer,
		controller: controller,
	}
	return podCache
}
var ErrMultipleRunningPods = fmt.Errorf("multiple running pods found")