Documentation ¶
Index ¶
- type RuntimeInfoStore
- func (r *RuntimeInfoStore) CheckContainerStatusNeedSync(bizStatusData model.BizStatusData) bool
- func (r *RuntimeInfoStore) DeletePod(podKey string, t tunnel.Tunnel)
- func (r *RuntimeInfoStore) GetPodByKey(podKey string) *corev1.Pod
- func (r *RuntimeInfoStore) GetPods() []*corev1.Pod
- func (r *RuntimeInfoStore) PutPod(pod *corev1.Pod, t tunnel.Tunnel)
- type VPodProvider
- func (b *VPodProvider) CreatePod(ctx context.Context, pod *corev1.Pod) error
- func (b *VPodProvider) DeletePod(ctx context.Context, pod *corev1.Pod) error
- func (b *VPodProvider) GetPod(_ context.Context, namespace, name string) (*corev1.Pod, error)
- func (b *VPodProvider) GetPodStatus(ctx context.Context, pod *corev1.Pod, bizStatus model.BizStatusData) (*corev1.PodStatus, error)
- func (b *VPodProvider) GetPods(_ context.Context) ([]*corev1.Pod, error)
- func (b *VPodProvider) NotifyPods(_ context.Context, cb func(*corev1.Pod))
- func (b *VPodProvider) SyncAllContainerInfo(ctx context.Context, bizStatusDatas []model.BizStatusData)
- func (b *VPodProvider) SyncOneContainerInfo(ctx context.Context, bizStatusData model.BizStatusData)
- func (b *VPodProvider) UpdatePod(ctx context.Context, pod *corev1.Pod) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RuntimeInfoStore ¶
type RuntimeInfoStore struct { sync.RWMutex // This mutex is used for thread-safe access to the store. // contains filtered or unexported fields }
RuntimeInfoStore provides in-memory runtime information.
func NewRuntimeInfoStore ¶
func NewRuntimeInfoStore() *RuntimeInfoStore
func (*RuntimeInfoStore) CheckContainerStatusNeedSync ¶ added in v0.3.4
func (r *RuntimeInfoStore) CheckContainerStatusNeedSync(bizStatusData model.BizStatusData) bool
func (*RuntimeInfoStore) DeletePod ¶
func (r *RuntimeInfoStore) DeletePod(podKey string, t tunnel.Tunnel)
DeletePod function removes a pod from the RuntimeInfoStore.
func (*RuntimeInfoStore) GetPodByKey ¶
func (r *RuntimeInfoStore) GetPodByKey(podKey string) *corev1.Pod
GetPodByKey function retrieves a pod by its key.
func (*RuntimeInfoStore) GetPods ¶
func (r *RuntimeInfoStore) GetPods() []*corev1.Pod
GetPods function retrieves all pods in the RuntimeInfoStore.
type VPodProvider ¶
type VPodProvider struct { Namespace string // contains filtered or unexported fields }
VPodProvider is a struct that implements the nodeutil.Provider and virtual_kubelet.PodNotifier interfaces
func NewVPodProvider ¶
func NewVPodProvider(namespace, localIP, nodeID string, client client.Client, t tunnel.Tunnel) *VPodProvider
NewVPodProvider is a function that creates a new VPodProvider instance
func (*VPodProvider) GetPod ¶
GetPod is a method of VPodProvider that gets a pod This method is simply used to return the observed defaultPod by local
so the outer control loop can call CreatePod / UpdatePod / DeletePod accordingly just return the defaultPod from the local store
func (*VPodProvider) GetPodStatus ¶
func (b *VPodProvider) GetPodStatus(ctx context.Context, pod *corev1.Pod, bizStatus model.BizStatusData) (*corev1.PodStatus, error)
GetPodStatus is a method of VPodProvider that gets the status of a pod This will be called repeatedly by virtual kubelet framework to get the defaultPod status we should query the actual runtime info and convert them in to V1PodStatus accordingly
func (*VPodProvider) NotifyPods ¶
func (b *VPodProvider) NotifyPods(_ context.Context, cb func(*corev1.Pod))
NotifyPods is a method of VPodProvider that sets the notify function
func (*VPodProvider) SyncAllContainerInfo ¶ added in v0.3.1
func (b *VPodProvider) SyncAllContainerInfo(ctx context.Context, bizStatusDatas []model.BizStatusData)
SyncAllContainerInfo is a method of VPodProvider that synchronizes the information of all containers
func (*VPodProvider) SyncOneContainerInfo ¶ added in v0.3.1
func (b *VPodProvider) SyncOneContainerInfo(ctx context.Context, bizStatusData model.BizStatusData)
SyncOneContainerInfo is a method of VPodProvider that synchronizes the information of a single container