podstore

package
v0.0.0-...-bc30bd0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const AssumedPodExpiration = 900 * time.Second
View Source
const Name commonstore.StoreName = "PodStore"

Variables

This section is empty.

Functions

func NewCache

func NewCache(handler commoncache.CacheHandler) commonstore.Store

func NewSnapshot

func NewSnapshot(handler commoncache.CacheHandler) commonstore.Store

Types

type PodStore

type PodStore struct {
	commonstore.BaseStore

	// a set of assumed pod keys.
	// The key could further be used to get an entry in PodStates.
	AssumedPods map[string]bool
	// a map from pod key to podState.
	PodStates map[string]*framework.CachePodState
	// contains filtered or unexported fields
}

func (*PodStore) AddPod

func (s *PodStore) AddPod(pod *v1.Pod) error

func (*PodStore) AssumePod

func (s *PodStore) AssumePod(podInfo *framework.CachePodInfo) error

func (*PodStore) CleanupExpiredAssumedPods

func (s *PodStore) CleanupExpiredAssumedPods(mu *sync.RWMutex, now time.Time)

cleanupAssumedPods exists for making test deterministic by taking time as input argument. It also reports metrics on the cache size for nodes, pods, and assumed pods.

func (*PodStore) DeletePod

func (s *PodStore) DeletePod(pod *v1.Pod) error

func (*PodStore) FinishBinding

func (s *PodStore) FinishBinding(pod *v1.Pod, now time.Time) error

func (*PodStore) ForgetPod

func (s *PodStore) ForgetPod(podInfo *framework.CachePodInfo) error

func (*PodStore) GetPod

func (s *PodStore) GetPod(pod *v1.Pod) (*v1.Pod, error)

func (*PodStore) GetPodState

func (s *PodStore) GetPodState(key string) (*framework.CachePodState, bool)

func (*PodStore) IsAssumedPod

func (s *PodStore) IsAssumedPod(pod *v1.Pod) (bool, error)

func (*PodStore) IsCachedPod

func (s *PodStore) IsCachedPod(pod *v1.Pod) (bool, error)

func (*PodStore) Name

func (s *PodStore) Name() commonstore.StoreName

func (*PodStore) PeriodWorker

func (s *PodStore) PeriodWorker(mu *sync.RWMutex)

func (*PodStore) UpdatePod

func (s *PodStore) UpdatePod(oldPod *v1.Pod, newPod *v1.Pod) error

ATTENTION: Previously, assumed pods were converted to bound pods by AddPod, but this is actually a pod update event. At this point, the oldPod does not carry information about the assume, so you MUST try to get the state of the once-assumed pod from the Cache.

func (*PodStore) UpdateSnapshot

func (s *PodStore) UpdateSnapshot(_ commonstore.Store) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL