adapter

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 20 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() client.Object
	// NewResourceListObject creates a empty subset list object.
	NewResourceListObject() client.ObjectList
	// 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() client.ObjectList

NewResourceListObject creates a empty AdvancedStatefulSet object.

func (*AdvancedStatefulSetAdapter) NewResourceObject

func (a *AdvancedStatefulSetAdapter) NewResourceObject() client.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 CloneSetAdapter added in v0.6.1

type CloneSetAdapter struct {
	client.Client
	Scheme *runtime.Scheme
}

func (*CloneSetAdapter) ApplySubsetTemplate added in v0.6.1

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

func (*CloneSetAdapter) GetObjectMeta added in v0.6.1

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

func (*CloneSetAdapter) GetReplicaDetails added in v0.6.1

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

func (*CloneSetAdapter) GetStatusObservedGeneration added in v0.6.1

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

func (*CloneSetAdapter) GetSubsetFailure added in v0.6.1

func (a *CloneSetAdapter) GetSubsetFailure() *string

func (*CloneSetAdapter) IsExpected added in v0.6.1

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

func (*CloneSetAdapter) NewResourceListObject added in v0.6.1

func (a *CloneSetAdapter) NewResourceListObject() client.ObjectList

func (*CloneSetAdapter) NewResourceObject added in v0.6.1

func (a *CloneSetAdapter) NewResourceObject() client.Object

func (*CloneSetAdapter) PostUpdate added in v0.6.1

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

type DeploymentAdapter added in v0.8.0

type DeploymentAdapter struct {
	client.Client

	Scheme *runtime.Scheme
}

DeploymentAdapter implements the Adapter interface for Deployment objects

func (*DeploymentAdapter) ApplySubsetTemplate added in v0.8.0

func (a *DeploymentAdapter) 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 DeploymentTemplate.

func (*DeploymentAdapter) GetReplicaDetails added in v0.8.0

func (a *DeploymentAdapter) 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 (*DeploymentAdapter) GetStatusObservedGeneration added in v0.8.0

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

GetStatusObservedGeneration returns the observed generation of the subset.

func (*DeploymentAdapter) GetSubsetFailure added in v0.8.0

func (a *DeploymentAdapter) GetSubsetFailure() *string

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

func (*DeploymentAdapter) IsExpected added in v0.8.0

func (a *DeploymentAdapter) 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 (*DeploymentAdapter) NewResourceListObject added in v0.8.0

func (a *DeploymentAdapter) NewResourceListObject() client.ObjectList

NewResourceListObject creates a empty DeploymentList object.

func (*DeploymentAdapter) NewResourceObject added in v0.8.0

func (a *DeploymentAdapter) NewResourceObject() client.Object

NewResourceObject creates a empty Deployment object.

func (*DeploymentAdapter) PostUpdate added in v0.8.0

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

PostUpdate does some works after subset updated. Deployments typically don't have post update operations.

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() client.ObjectList

NewResourceListObject creates a empty StatefulSetList object.

func (*StatefulSetAdapter) NewResourceObject

func (a *StatefulSetAdapter) NewResourceObject() client.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