Documentation ¶
Index ¶
- Constants
- Variables
- func AddOrUpdateCondition(status *appsv1alpha1.CollaSetStatus, ...)
- func ApplyPatchFromRevision(pod *corev1.Pod, revision *appsv1.ControllerRevision) (*corev1.Pod, error)
- func BuildPvcWithHash(cls *appsv1alpha1.CollaSet, pvcTmp *corev1.PersistentVolumeClaim, id string) (*corev1.PersistentVolumeClaim, error)
- func CollectPodInstanceID(pods []*PodWrapper) map[int]struct{}
- func ComparePod(l, r *corev1.Pod) bool
- func ExtractPvcTmpName(cls *appsv1alpha1.CollaSet, pvc *corev1.PersistentVolumeClaim) (string, error)
- func GetCondition(status *appsv1alpha1.CollaSetStatus, ...) *appsv1alpha1.CollaSetCondition
- func GetPodFromRevision(revision *appsv1.ControllerRevision) (*corev1.Pod, error)
- func GetPodInstanceID(pod *corev1.Pod) (int, error)
- func GetPodRevisionPatch(revision *appsv1.ControllerRevision) ([]byte, error)
- func GetPodsPrefix(controllerName string) string
- func InitExpectations(c client.Client)
- func IsPodUpdatedRevision(pod *corev1.Pod, revision string) bool
- func NewCondition(condType appsv1alpha1.CollaSetConditionType, status corev1.ConditionStatus, ...) *appsv1alpha1.CollaSetCondition
- func NewPodFrom(owner metav1.Object, ownerRef *metav1.OwnerReference, ...) (*corev1.Pod, error)
- func PatchToPod(currentRevisionPod, updateRevisionPod, currentPod *corev1.Pod) (*corev1.Pod, error)
- func PvcPolicyWhenDelete(cls *appsv1alpha1.CollaSet) appsv1alpha1.PersistentVolumeClaimRetentionPolicyType
- func PvcPolicyWhenScaled(cls *appsv1alpha1.CollaSet) appsv1alpha1.PersistentVolumeClaimRetentionPolicyType
- func PvcTmpHash(pvc *corev1.PersistentVolumeClaim) (string, error)
- func PvcTmpHashMapping(pvcTmps []corev1.PersistentVolumeClaim) (map[string]string, error)
- func RemoveCondition(status *appsv1alpha1.CollaSetStatus, ...)
- func SetCondition(status *appsv1alpha1.CollaSetStatus, condition *appsv1alpha1.CollaSetCondition)
- type CollaSetScaleInOpsLifecycleAdapter
- func (a *CollaSetScaleInOpsLifecycleAdapter) AllowMultiType() bool
- func (a *CollaSetScaleInOpsLifecycleAdapter) GetID() string
- func (a *CollaSetScaleInOpsLifecycleAdapter) GetType() podopslifecycle.OperationType
- func (a *CollaSetScaleInOpsLifecycleAdapter) WhenBegin(pod client.Object) (bool, error)
- func (a *CollaSetScaleInOpsLifecycleAdapter) WhenFinish(_ client.Object) (bool, error)
- type CollaSetUpdateOpsLifecycleAdapter
- func (a *CollaSetUpdateOpsLifecycleAdapter) AllowMultiType() bool
- func (a *CollaSetUpdateOpsLifecycleAdapter) GetID() string
- func (a *CollaSetUpdateOpsLifecycleAdapter) GetType() podopslifecycle.OperationType
- func (a *CollaSetUpdateOpsLifecycleAdapter) WhenBegin(_ client.Object) (bool, error)
- func (a *CollaSetUpdateOpsLifecycleAdapter) WhenFinish(pod client.Object) (bool, error)
- type PodWrapper
- type RelatedResources
Constants ¶
const ConditionUpdatePeriodBackOff = 30 * time.Second
Variables ¶
var ( UpdateOpsLifecycleAdapter = &CollaSetUpdateOpsLifecycleAdapter{} ScaleInOpsLifecycleAdapter = &CollaSetScaleInOpsLifecycleAdapter{} )
var ( // ActiveExpectations is used to check the cache in informer is updated, before reconciling. ActiveExpectations *expectations.ActiveExpectations )
Functions ¶
func AddOrUpdateCondition ¶
func AddOrUpdateCondition(status *appsv1alpha1.CollaSetStatus, conditionType appsv1alpha1.CollaSetConditionType, err error, reason, message string)
func ApplyPatchFromRevision ¶ added in v0.2.0
func BuildPvcWithHash ¶ added in v0.3.0
func BuildPvcWithHash(cls *appsv1alpha1.CollaSet, pvcTmp *corev1.PersistentVolumeClaim, id string) (*corev1.PersistentVolumeClaim, error)
func CollectPodInstanceID ¶
func CollectPodInstanceID(pods []*PodWrapper) map[int]struct{}
func ComparePod ¶ added in v0.2.0
func ExtractPvcTmpName ¶ added in v0.3.0
func ExtractPvcTmpName(cls *appsv1alpha1.CollaSet, pvc *corev1.PersistentVolumeClaim) (string, error)
func GetCondition ¶
func GetCondition(status *appsv1alpha1.CollaSetStatus, condType appsv1alpha1.CollaSetConditionType) *appsv1alpha1.CollaSetCondition
GetCondition returns a inplace set condition with the provided type if it exists.
func GetPodFromRevision ¶ added in v0.2.0
func GetPodFromRevision(revision *appsv1.ControllerRevision) (*corev1.Pod, error)
func GetPodRevisionPatch ¶ added in v0.2.0
func GetPodRevisionPatch(revision *appsv1.ControllerRevision) ([]byte, error)
func GetPodsPrefix ¶ added in v0.2.0
func InitExpectations ¶
func IsPodUpdatedRevision ¶ added in v0.2.0
func NewCondition ¶
func NewCondition(condType appsv1alpha1.CollaSetConditionType, status corev1.ConditionStatus, reason, msg string) *appsv1alpha1.CollaSetCondition
func NewPodFrom ¶
func PatchToPod ¶ added in v0.2.0
PatchToPod Use three-way merge to get a updated pod.
func PvcPolicyWhenDelete ¶ added in v0.3.0
func PvcPolicyWhenDelete(cls *appsv1alpha1.CollaSet) appsv1alpha1.PersistentVolumeClaimRetentionPolicyType
func PvcPolicyWhenScaled ¶ added in v0.3.0
func PvcPolicyWhenScaled(cls *appsv1alpha1.CollaSet) appsv1alpha1.PersistentVolumeClaimRetentionPolicyType
func PvcTmpHash ¶ added in v0.3.0
func PvcTmpHash(pvc *corev1.PersistentVolumeClaim) (string, error)
func PvcTmpHashMapping ¶ added in v0.3.0
func PvcTmpHashMapping(pvcTmps []corev1.PersistentVolumeClaim) (map[string]string, error)
func RemoveCondition ¶
func RemoveCondition(status *appsv1alpha1.CollaSetStatus, condType appsv1alpha1.CollaSetConditionType)
RemoveCondition removes the condition with the provided type from the replicaset status.
func SetCondition ¶
func SetCondition(status *appsv1alpha1.CollaSetStatus, condition *appsv1alpha1.CollaSetCondition)
SetCondition adds/replaces the given condition in the replicaset status. If the condition that we are about to add already exists and has the same status and reason then we are not going to update.
Types ¶
type CollaSetScaleInOpsLifecycleAdapter ¶
type CollaSetScaleInOpsLifecycleAdapter struct { }
CollaSetScaleInOpsLifecycleAdapter tells PodOpsLifecycle the basic workload scaling in ops info
func (*CollaSetScaleInOpsLifecycleAdapter) AllowMultiType ¶
func (a *CollaSetScaleInOpsLifecycleAdapter) AllowMultiType() bool
AllowMultiType indicates whether multiple IDs which have the same Type are allowed
func (*CollaSetScaleInOpsLifecycleAdapter) GetID ¶
func (a *CollaSetScaleInOpsLifecycleAdapter) GetID() string
GetID indicates ID of one PodOpsLifecycle
func (*CollaSetScaleInOpsLifecycleAdapter) GetType ¶
func (a *CollaSetScaleInOpsLifecycleAdapter) GetType() podopslifecycle.OperationType
GetType indicates type for an Operator
func (*CollaSetScaleInOpsLifecycleAdapter) WhenBegin ¶
func (a *CollaSetScaleInOpsLifecycleAdapter) WhenBegin(pod client.Object) (bool, error)
WhenBegin will be executed when begin a lifecycle
func (*CollaSetScaleInOpsLifecycleAdapter) WhenFinish ¶
func (a *CollaSetScaleInOpsLifecycleAdapter) WhenFinish(_ client.Object) (bool, error)
WhenFinish will be executed when finish a lifecycle
type CollaSetUpdateOpsLifecycleAdapter ¶
type CollaSetUpdateOpsLifecycleAdapter struct { }
CollaSetUpdateOpsLifecycleAdapter tells PodOpsLifecycle the basic workload update ops info
func (*CollaSetUpdateOpsLifecycleAdapter) AllowMultiType ¶
func (a *CollaSetUpdateOpsLifecycleAdapter) AllowMultiType() bool
AllowMultiType indicates whether multiple IDs which have the same Type are allowed
func (*CollaSetUpdateOpsLifecycleAdapter) GetID ¶
func (a *CollaSetUpdateOpsLifecycleAdapter) GetID() string
GetID indicates ID of one PodOpsLifecycle
func (*CollaSetUpdateOpsLifecycleAdapter) GetType ¶
func (a *CollaSetUpdateOpsLifecycleAdapter) GetType() podopslifecycle.OperationType
GetType indicates type for an Operator
func (*CollaSetUpdateOpsLifecycleAdapter) WhenBegin ¶
func (a *CollaSetUpdateOpsLifecycleAdapter) WhenBegin(_ client.Object) (bool, error)
WhenBegin will be executed when begin a lifecycle
func (*CollaSetUpdateOpsLifecycleAdapter) WhenFinish ¶
func (a *CollaSetUpdateOpsLifecycleAdapter) WhenFinish(pod client.Object) (bool, error)
WhenFinish will be executed when finish a lifecycle
type PodWrapper ¶
type PodWrapper struct { *corev1.Pod ID int ContextDetail *appsv1alpha1.ContextDetail // TODO ToExclude ToDelete bool }
type RelatedResources ¶ added in v0.2.0
type RelatedResources struct { Revisions []*appsv1.ControllerRevision CurrentRevision *appsv1.ControllerRevision UpdatedRevision *appsv1.ControllerRevision ExistingPvcs []*corev1.PersistentVolumeClaim PDGetter utilspoddecoration.Getter NewStatus *appsv1alpha1.CollaSetStatus }