adapter

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	// NewResourceObject creates a empty subset object.
	NewResourceObject() runtime.Object
	// NewResourceListObject creates a empty subset list object.
	NewResourceListObject() runtime.Object
	// GetStatusObservedGeneration returns the observed generation of the subset.
	GetStatusObservedGeneration(subset metav1.Object) int64
	// GetReplicaDetails returns the replicas information of the subset status.
	GetReplicaDetails(subset metav1.Object, updatedRevision string) (specReplicas, specPartition *int32, statusReplicas, statusReadyReplicas, statusUpdatedReplicas, statusUpdatedReadyReplicas int32, err error)
	// GetSubsetFailure returns failure information of the subset.
	GetSubsetFailure() *string
	// ApplySubsetTemplate updates the subset to the latest revision.
	ApplySubsetTemplate(ud *alpha1.UnitedDeployment, subsetName, revision string, replicas, partition int32, subset runtime.Object) error
	// IsExpected checks the subset is the expected revision or not.
	// If not, UnitedDeployment will call ApplySubsetTemplate to update it.
	IsExpected(subset metav1.Object, revision string) bool
	// PostUpdate does some works after subset updated
	PostUpdate(ud *alpha1.UnitedDeployment, subset runtime.Object, revision string, partition int32) error
}

type AdvancedStatefulSetAdapter

type AdvancedStatefulSetAdapter struct {
	client.Client

	Scheme *runtime.Scheme
}

func (*AdvancedStatefulSetAdapter) ApplySubsetTemplate

func (a *AdvancedStatefulSetAdapter) ApplySubsetTemplate(ud *alpha1.UnitedDeployment, subsetName, revision string, replicas, partition int32, obj runtime.Object) error

ApplySubsetTemplate updates the subset to the latest revision, depending on the AdvancedStatefulSetTemplate.

func (*AdvancedStatefulSetAdapter) ConvertToResourceList

func (a *AdvancedStatefulSetAdapter) ConvertToResourceList(obj runtime.Object) []metav1.Object

ConvertToResourceList converts AdvancedStatefulSetList object to AdvancedStatefulSet array.

func (*AdvancedStatefulSetAdapter) GetObjectMeta

func (a *AdvancedStatefulSetAdapter) GetObjectMeta(obj metav1.Object) *metav1.ObjectMeta

GetObjectMeta returns the ObjectMeta of the subset of AdvancedStatefulSet.

func (*AdvancedStatefulSetAdapter) GetReplicaDetails

func (a *AdvancedStatefulSetAdapter) GetReplicaDetails(obj metav1.Object, updatedRevision string) (specReplicas, specPartition *int32, statusReplicas, statusReadyReplicas, statusUpdatedReplicas, statusUpdatedReadyReplicas int32, err error)

GetReplicaDetails returns the replicas detail the subset needs.

func (*AdvancedStatefulSetAdapter) GetStatusObservedGeneration

func (a *AdvancedStatefulSetAdapter) GetStatusObservedGeneration(obj metav1.Object) int64

GetStatusObservedGeneration returns the observed generation of the subset.

func (*AdvancedStatefulSetAdapter) GetSubsetFailure

func (a *AdvancedStatefulSetAdapter) GetSubsetFailure() *string

GetSubsetFailure returns the failure information of the subset. AdvancedStatefulSet has no condition.

func (*AdvancedStatefulSetAdapter) IsExpected

func (a *AdvancedStatefulSetAdapter) IsExpected(obj metav1.Object, revision string) bool

IsExpected checks the subset is the expected revision or not. The revision label can tell the current subset revision.

func (*AdvancedStatefulSetAdapter) NewResourceListObject

func (a *AdvancedStatefulSetAdapter) NewResourceListObject() runtime.Object

NewResourceListObject creates a empty AdvancedStatefulSet object.

func (*AdvancedStatefulSetAdapter) NewResourceObject

func (a *AdvancedStatefulSetAdapter) NewResourceObject() runtime.Object

NewResourceObject creates a empty AdvancedStatefulSet object.

func (*AdvancedStatefulSetAdapter) PostUpdate

func (a *AdvancedStatefulSetAdapter) PostUpdate(ud *alpha1.UnitedDeployment, obj runtime.Object, revision string, partition int32) error

PostUpdate does some works after subset updated.

type StatefulSetAdapter

type StatefulSetAdapter struct {
	client.Client

	Scheme *runtime.Scheme
}

func (*StatefulSetAdapter) ApplySubsetTemplate

func (a *StatefulSetAdapter) ApplySubsetTemplate(ud *alpha1.UnitedDeployment, subsetName, revision string, replicas, partition int32, obj runtime.Object) error

ApplySubsetTemplate updates the subset to the latest revision, depending on the StatefulSetTemplate.

func (*StatefulSetAdapter) GetReplicaDetails

func (a *StatefulSetAdapter) GetReplicaDetails(obj metav1.Object, updatedRevision string) (specReplicas, specPartition *int32, statusReplicas, statusReadyReplicas, statusUpdatedReplicas, statusUpdatedReadyReplicas int32, err error)

GetReplicaDetails returns the replicas detail the subset needs.

func (*StatefulSetAdapter) GetStatusObservedGeneration

func (a *StatefulSetAdapter) GetStatusObservedGeneration(obj metav1.Object) int64

GetStatusObservedGeneration returns the observed generation of the subset.

func (*StatefulSetAdapter) GetSubsetFailure

func (a *StatefulSetAdapter) GetSubsetFailure() *string

GetSubsetFailure returns the failure information of the subset. StatefulSet has no condition.

func (*StatefulSetAdapter) IsExpected

func (a *StatefulSetAdapter) IsExpected(obj metav1.Object, revision string) bool

IsExpected checks the subset is the expected revision or not. The revision label can tell the current subset revision.

func (*StatefulSetAdapter) NewResourceListObject

func (a *StatefulSetAdapter) NewResourceListObject() runtime.Object

NewResourceListObject creates a empty StatefulSetList object.

func (*StatefulSetAdapter) NewResourceObject

func (a *StatefulSetAdapter) NewResourceObject() runtime.Object

NewResourceObject creates a empty StatefulSet object.

func (*StatefulSetAdapter) PostUpdate

func (a *StatefulSetAdapter) PostUpdate(ud *alpha1.UnitedDeployment, obj runtime.Object, revision string, partition int32) error

PostUpdate does some works after subset updated. StatefulSet will implement this method to clean stuck pods.

Jump to

Keyboard shortcuts

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