synccontrol

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScaleInContextDataKey = "ScaleIn"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivePodsForDeletion

type ActivePodsForDeletion []*collasetutils.PodWrapper

func (ActivePodsForDeletion) Len

func (s ActivePodsForDeletion) Len() int

func (ActivePodsForDeletion) Less

func (s ActivePodsForDeletion) Less(i, j int) bool

func (ActivePodsForDeletion) Swap

func (s ActivePodsForDeletion) Swap(i, j int)

type ContainerStatus

type ContainerStatus struct {
	LatestImage string `json:"latestImage,omitempty"`
	LastImageID string `json:"lastImageID,omitempty"`
}

type GenericPodUpdater added in v0.4.0

type GenericPodUpdater struct {
	client.Client
	// contains filtered or unexported fields
}

func (*GenericPodUpdater) BeginUpdatePod added in v0.4.0

func (u *GenericPodUpdater) BeginUpdatePod(resources *collasetutils.RelatedResources, podCh chan *PodUpdateInfo) (bool, error)

func (*GenericPodUpdater) FilterAllowOpsPods added in v0.4.0

func (u *GenericPodUpdater) FilterAllowOpsPods(podToUpdate []*PodUpdateInfo, ownedIDs map[int]*appsv1alpha1.ContextDetail, resources *collasetutils.RelatedResources, podCh chan *PodUpdateInfo) (*time.Duration, error)

func (*GenericPodUpdater) FinishUpdatePod added in v0.4.0

func (u *GenericPodUpdater) FinishUpdatePod(podInfo *PodUpdateInfo) error

type Interface

type Interface interface {
	SyncPods(
		ctx context.Context,
		instance *appsv1alpha1.CollaSet,
		resources *collasetutils.RelatedResources,
	) (bool, []*collasetutils.PodWrapper, map[int]*appsv1alpha1.ContextDetail, error)

	Scale(
		ctx context.Context,
		instance *appsv1alpha1.CollaSet,
		resources *collasetutils.RelatedResources,
		filteredPods []*collasetutils.PodWrapper,
		ownedIDs map[int]*appsv1alpha1.ContextDetail,
	) (bool, *time.Duration, error)

	Update(
		ctx context.Context,
		instance *appsv1alpha1.CollaSet,
		resources *collasetutils.RelatedResources,
		filteredPods []*collasetutils.PodWrapper,
		ownedIDs map[int]*appsv1alpha1.ContextDetail,
	) (bool, *time.Duration, error)
}

func NewRealSyncControl

func NewRealSyncControl(client client.Client, logger logr.Logger, podControl podcontrol.Interface, pvcControl pvccontrol.Interface, recorder record.EventRecorder) Interface

type PodStatus

type PodStatus struct {
	ContainerStates map[string]*ContainerStatus `json:"containerStates,omitempty"`
}

type PodUpdateInfo

type PodUpdateInfo struct {
	*utils.PodWrapper

	UpdatedPod *corev1.Pod

	InPlaceUpdateSupport bool
	OnlyMetadataChanged  bool

	// indicate if this pod has up-to-date revision from its owner, like CollaSet
	IsUpdatedRevision bool
	// carry the pod's current revision
	CurrentRevision *appsv1.ControllerRevision
	// carry the desired update revision
	UpdateRevision *appsv1.ControllerRevision

	// indicates effected PodDecorations changed
	PodDecorationChanged bool
	// indicate if the pvc template changed
	PvcTmpHashChanged bool

	CurrentPodDecorations map[string]*appsv1alpha1.PodDecoration
	UpdatedPodDecorations map[string]*appsv1alpha1.PodDecoration
	// contains filtered or unexported fields
}

type PodUpdater

type PodUpdater interface {
	FulfillPodUpdatedInfo(revision *appsv1.ControllerRevision, podUpdateInfo *PodUpdateInfo) error
	BeginUpdatePod(resources *collasetutils.RelatedResources, podCh chan *PodUpdateInfo) (bool, error)
	FilterAllowOpsPods(podToUpdate []*PodUpdateInfo, ownedIDs map[int]*appsv1alpha1.ContextDetail, resources *collasetutils.RelatedResources, podCh chan *PodUpdateInfo) (*time.Duration, error)
	UpgradePod(podInfo *PodUpdateInfo) error
	GetPodUpdateFinishStatus(podUpdateInfo *PodUpdateInfo) (bool, string, error)
	FinishUpdatePod(podInfo *PodUpdateInfo) error
}

type RealSyncControl

type RealSyncControl struct {
	// contains filtered or unexported fields
}

func (*RealSyncControl) Scale

func (*RealSyncControl) SyncPods

SyncPods is used to reclaim Pod instance ID

func (*RealSyncControl) Update

Jump to

Keyboard shortcuts

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