Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchContext ¶
type BatchContext struct {
RolloutID string `json:"rolloutID,omitempty"`
// current batch index, start from 0
CurrentBatch int32 `json:"currentBatchIndex"`
// workload update revision
UpdateRevision string `json:"updateRevision,omitempty"`
// workload replicas
Replicas int32 `json:"replicas"`
// Updated replicas
UpdatedReplicas int32 `json:"updatedReplicas"`
// Updated ready replicas
UpdatedReadyReplicas int32 `json:"updatedReadyReplicas"`
// no need update replicas that marked before rollout
NoNeedUpdatedReplicas *int32 `json:"noNeedUpdatedReplicas,omitempty"`
// the planned number of Pods should be upgrade in current batch
// this field corresponds to releasePlan.Batches[currentBatch]
PlannedUpdatedReplicas int32 `json:"plannedUpdatedReplicas,omitempty"`
// the total number of the really updated pods you desired in current batch.
// In most normal cases, this field will equal to PlannedUpdatedReplicas,
// but in some scene, e.g., rolling back in batches, the really desired updated
// replicas will not equal to planned update replicas, because we just roll the
// pods that really need update back in batches.
DesiredUpdatedReplicas int32 `json:"desiredUpdatedReplicas,omitempty"`
// workload current partition
CurrentPartition intstr.IntOrString `json:"currentPartition,omitempty"`
// desired partition replicas in current batch
DesiredPartition intstr.IntOrString `json:"desiredPartition,omitempty"`
// failureThreshold to tolerate unready updated replicas;
FailureThreshold *intstr.IntOrString `json:"failureThreshold,omitempty"`
// the pods owned by workload
Pods []*corev1.Pod `json:"-"`
// filter or sort pods before patch label
FilterFunc FilterFuncType `json:"-"`
// the next two fields are only used for bluegreen style
CurrentSurge intstr.IntOrString `json:"currentSurge,omitempty"`
DesiredSurge intstr.IntOrString `json:"desiredSurge,omitempty"`
}
func (*BatchContext) IsBatchReady ¶
func (bc *BatchContext) IsBatchReady() error
IsBatchReady return nil if the batch is ready
func (*BatchContext) Log ¶
func (bc *BatchContext) Log() string
type FilterFuncType ¶
type FilterFuncType func(pods []*corev1.Pod, ctx *BatchContext) []*corev1.Pod
Click to show internal directories.
Click to hide internal directories.