Documentation ¶
Index ¶
- Constants
- func FilterOutPlaceHolderPodWrappers(pods []*collasetutils.PodWrapper) []*collasetutils.PodWrapper
- func RecreatePod(collaSet *appsv1alpha1.CollaSet, podInfo *PodUpdateInfo, ...) error
- func RegisterInPlaceOnlyUpdater(podUpdater PodUpdater)
- type ActivePodsForDeletion
- type ContainerStatus
- type GenericPodUpdater
- func (u *GenericPodUpdater) BeginUpdatePod(_ context.Context, resources *collasetutils.RelatedResources, ...) (bool, error)
- func (u *GenericPodUpdater) FilterAllowOpsPods(_ context.Context, candidates []*PodUpdateInfo, ...) (*time.Duration, error)
- func (u *GenericPodUpdater) FinishUpdatePod(_ context.Context, podInfo *PodUpdateInfo) error
- func (u *GenericPodUpdater) Setup(client client.Client, cls *appsv1alpha1.CollaSet, ...)
- type Interface
- type PodStatus
- type PodUpdateInfo
- type PodUpdater
- type RealSyncControl
- func (r *RealSyncControl) Scale(ctx context.Context, cls *appsv1alpha1.CollaSet, ...) (bool, *time.Duration, error)
- func (r *RealSyncControl) SyncPods(ctx context.Context, instance *appsv1alpha1.CollaSet, ...) (bool, []*collasetutils.PodWrapper, map[int]*appsv1alpha1.ContextDetail, error)
- func (r *RealSyncControl) Update(ctx context.Context, cls *appsv1alpha1.CollaSet, ...) (bool, *time.Duration, error)
Constants ¶
View Source
const ( ReplaceNewPodIDContextDataKey = "ReplaceNewPodID" ReplaceOriginPodIDContextDataKey = "ReplaceOriginPodID" )
View Source
const (
ScaleInContextDataKey = "ScaleIn"
)
Variables ¶
This section is empty.
Functions ¶
func FilterOutPlaceHolderPodWrappers ¶
func FilterOutPlaceHolderPodWrappers(pods []*collasetutils.PodWrapper) []*collasetutils.PodWrapper
func RecreatePod ¶
func RecreatePod(collaSet *appsv1alpha1.CollaSet, podInfo *PodUpdateInfo, podControl podcontrol.Interface, recorder record.EventRecorder) error
func RegisterInPlaceOnlyUpdater ¶
func RegisterInPlaceOnlyUpdater(podUpdater PodUpdater)
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 GenericPodUpdater ¶
type GenericPodUpdater struct { *appsv1alpha1.CollaSet PodControl podcontrol.Interface Recorder record.EventRecorder client.Client }
func (*GenericPodUpdater) BeginUpdatePod ¶
func (u *GenericPodUpdater) BeginUpdatePod(_ context.Context, resources *collasetutils.RelatedResources, podCh chan *PodUpdateInfo) (bool, error)
func (*GenericPodUpdater) FilterAllowOpsPods ¶
func (u *GenericPodUpdater) FilterAllowOpsPods(_ context.Context, candidates []*PodUpdateInfo, ownedIDs map[int]*appsv1alpha1.ContextDetail, _ *collasetutils.RelatedResources, podCh chan *PodUpdateInfo) (*time.Duration, error)
func (*GenericPodUpdater) FinishUpdatePod ¶
func (u *GenericPodUpdater) FinishUpdatePod(_ context.Context, podInfo *PodUpdateInfo) error
func (*GenericPodUpdater) Setup ¶
func (u *GenericPodUpdater) Setup(client client.Client, cls *appsv1alpha1.CollaSet, podControl podcontrol.Interface, recorder record.EventRecorder)
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 { Setup(client.Client, *appsv1alpha1.CollaSet, podcontrol.Interface, record.EventRecorder) FulfillPodUpdatedInfo(ctx context.Context, revision *appsv1.ControllerRevision, podUpdateInfo *PodUpdateInfo) error BeginUpdatePod(ctx context.Context, resources *collasetutils.RelatedResources, podCh chan *PodUpdateInfo) (bool, error) FilterAllowOpsPods(ctx context.Context, podToUpdate []*PodUpdateInfo, ownedIDs map[int]*appsv1alpha1.ContextDetail, resources *collasetutils.RelatedResources, podCh chan *PodUpdateInfo) (*time.Duration, error) UpgradePod(ctx context.Context, podInfo *PodUpdateInfo) error GetPodUpdateFinishStatus(ctx context.Context, podUpdateInfo *PodUpdateInfo) (bool, string, error) FinishUpdatePod(ctx context.Context, podInfo *PodUpdateInfo) error }
type RealSyncControl ¶
type RealSyncControl struct {
// contains filtered or unexported fields
}
func (*RealSyncControl) Scale ¶
func (r *RealSyncControl) Scale( ctx context.Context, cls *appsv1alpha1.CollaSet, resources *collasetutils.RelatedResources, podWrappers []*collasetutils.PodWrapper, ownedIDs map[int]*appsv1alpha1.ContextDetail, ) (bool, *time.Duration, error)
func (*RealSyncControl) SyncPods ¶
func (r *RealSyncControl) SyncPods( ctx context.Context, instance *appsv1alpha1.CollaSet, resources *collasetutils.RelatedResources, ) ( bool, []*collasetutils.PodWrapper, map[int]*appsv1alpha1.ContextDetail, error)
SyncPods is used to reclaim Pod instance ID
func (*RealSyncControl) Update ¶
func (r *RealSyncControl) Update( ctx context.Context, cls *appsv1alpha1.CollaSet, resources *collasetutils.RelatedResources, podWrappers []*collasetutils.PodWrapper, ownedIDs map[int]*appsv1alpha1.ContextDetail, ) (bool, *time.Duration, error)
Click to show internal directories.
Click to hide internal directories.