Documentation ¶
Index ¶
- func CreateNewPatchedObject(patchInfo *runtime.RawExtension, set metav1.Object, newPatched metav1.Object) error
- func PoolHasPatch(poolConfig *appsv1alpha1.Pool, set metav1.Object) bool
- func StrategicMergeByPatches(oldobj interface{}, patch *runtime.RawExtension, newPatched interface{}) error
- type Adapter
- type DeploymentAdapter
- func (a *DeploymentAdapter) ApplyPoolTemplate(yas *alpha1.YurtAppSet, poolName, revision string, replicas int32, ...) error
- func (a *DeploymentAdapter) GetAvailableStatus(obj metav1.Object) (conditionStatus corev1.ConditionStatus, err error)
- func (a *DeploymentAdapter) GetDetails(obj metav1.Object) (ReplicasInfo, error)
- func (a *DeploymentAdapter) GetPoolFailure() *string
- func (a *DeploymentAdapter) GetStatusObservedGeneration(obj metav1.Object) int64
- func (a *DeploymentAdapter) IsExpected(obj metav1.Object, revision string) bool
- func (a *DeploymentAdapter) NewResourceListObject() runtime.Object
- func (a *DeploymentAdapter) NewResourceObject() runtime.Object
- func (a *DeploymentAdapter) PostUpdate(yas *alpha1.YurtAppSet, obj runtime.Object, revision string) error
- type ReplicasInfo
- type StatefulSetAdapter
- func (a *StatefulSetAdapter) ApplyPoolTemplate(yas *alpha1.YurtAppSet, poolName, revision string, replicas int32, ...) error
- func (a *StatefulSetAdapter) GetAvailableStatus(obj metav1.Object) (conditionStatus corev1.ConditionStatus, err error)
- func (a *StatefulSetAdapter) GetDetails(obj metav1.Object) (ReplicasInfo, error)
- func (a *StatefulSetAdapter) GetPoolFailure() *string
- func (a *StatefulSetAdapter) GetStatusObservedGeneration(obj metav1.Object) int64
- func (a *StatefulSetAdapter) IsExpected(obj metav1.Object, revision string) bool
- func (a *StatefulSetAdapter) NewResourceListObject() runtime.Object
- func (a *StatefulSetAdapter) NewResourceObject() runtime.Object
- func (a *StatefulSetAdapter) PostUpdate(yas *alpha1.YurtAppSet, obj runtime.Object, revision string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNewPatchedObject ¶
func PoolHasPatch ¶
func PoolHasPatch(poolConfig *appsv1alpha1.Pool, set metav1.Object) bool
func StrategicMergeByPatches ¶
func StrategicMergeByPatches(oldobj interface{}, patch *runtime.RawExtension, newPatched interface{}) error
Types ¶
type Adapter ¶
type Adapter interface { // NewResourceObject creates a empty pool object. NewResourceObject() runtime.Object // NewResourceListObject creates a empty pool list object. NewResourceListObject() runtime.Object // GetStatusObservedGeneration returns the observed generation of the pool. GetStatusObservedGeneration(pool metav1.Object) int64 // GetDetails returns the replicas information of the pool status. GetDetails(pool metav1.Object) (replicasInfo ReplicasInfo, err error) // GetAvailableStatus returns the available condition status of the workload GetAvailableStatus(set metav1.Object) (conditionStatus corev1.ConditionStatus, err error) // GetPoolFailure returns failure information of the pool. GetPoolFailure() *string // ApplyPoolTemplate updates the pool to the latest revision. ApplyPoolTemplate(yas *alpha1.YurtAppSet, poolName, revision string, replicas int32, pool runtime.Object) error // IsExpected checks the pool is the expected revision or not. // If not, YurtAppSet will call ApplyPoolTemplate to update it. IsExpected(pool metav1.Object, revision string) bool // PostUpdate does some works after pool updated PostUpdate(yas *alpha1.YurtAppSet, pool runtime.Object, revision string) error }
type DeploymentAdapter ¶
func (*DeploymentAdapter) ApplyPoolTemplate ¶
func (a *DeploymentAdapter) ApplyPoolTemplate(yas *alpha1.YurtAppSet, poolName, revision string, replicas int32, obj runtime.Object) error
ApplyPoolTemplate updates the pool to the latest revision, depending on the DeploymentTemplate.
func (*DeploymentAdapter) GetAvailableStatus ¶
func (a *DeploymentAdapter) GetAvailableStatus(obj metav1.Object) (conditionStatus corev1.ConditionStatus, err error)
GetAvailableStatus returns the available condition status of the workload
func (*DeploymentAdapter) GetDetails ¶
func (a *DeploymentAdapter) GetDetails(obj metav1.Object) (ReplicasInfo, error)
GetDetails returns the replicas detail the pool needs.
func (*DeploymentAdapter) GetPoolFailure ¶
func (a *DeploymentAdapter) GetPoolFailure() *string
GetPoolFailure returns the failure information of the pool. Deployment has no condition.
func (*DeploymentAdapter) GetStatusObservedGeneration ¶
func (a *DeploymentAdapter) GetStatusObservedGeneration(obj metav1.Object) int64
GetStatusObservedGeneration returns the observed generation of the pool.
func (*DeploymentAdapter) IsExpected ¶
func (a *DeploymentAdapter) IsExpected(obj metav1.Object, revision string) bool
IsExpected checks the pool is the expected revision or not. The revision label can tell the current pool revision.
func (*DeploymentAdapter) NewResourceListObject ¶
func (a *DeploymentAdapter) NewResourceListObject() runtime.Object
NewResourceListObject creates a empty DeploymentList object.
func (*DeploymentAdapter) NewResourceObject ¶
func (a *DeploymentAdapter) NewResourceObject() runtime.Object
NewResourceObject creates a empty Deployment object.
func (*DeploymentAdapter) PostUpdate ¶
func (a *DeploymentAdapter) PostUpdate(yas *alpha1.YurtAppSet, obj runtime.Object, revision string) error
PostUpdate does some works after pool updated. Deployment will implement this method to clean stuck pods.
type ReplicasInfo ¶
type StatefulSetAdapter ¶
func (*StatefulSetAdapter) ApplyPoolTemplate ¶
func (a *StatefulSetAdapter) ApplyPoolTemplate(yas *alpha1.YurtAppSet, poolName, revision string, replicas int32, obj runtime.Object) error
ApplyPoolTemplate updates the pool to the latest revision, depending on the StatefulSetTemplate.
func (*StatefulSetAdapter) GetAvailableStatus ¶
func (a *StatefulSetAdapter) GetAvailableStatus(obj metav1.Object) (conditionStatus corev1.ConditionStatus, err error)
GetAvailableStatus returns the available condition status of the workload
func (*StatefulSetAdapter) GetDetails ¶
func (a *StatefulSetAdapter) GetDetails(obj metav1.Object) (ReplicasInfo, error)
GetDetails returns the replicas detail the pool needs.
func (*StatefulSetAdapter) GetPoolFailure ¶
func (a *StatefulSetAdapter) GetPoolFailure() *string
GetPoolFailure returns the failure information of the pool. StatefulSet has no condition.
func (*StatefulSetAdapter) GetStatusObservedGeneration ¶
func (a *StatefulSetAdapter) GetStatusObservedGeneration(obj metav1.Object) int64
GetStatusObservedGeneration returns the observed generation of the pool.
func (*StatefulSetAdapter) IsExpected ¶
func (a *StatefulSetAdapter) IsExpected(obj metav1.Object, revision string) bool
IsExpected checks the pool is the expected revision or not. The revision label can tell the current pool 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(yas *alpha1.YurtAppSet, obj runtime.Object, revision string) error
PostUpdate does some works after pool updated. StatefulSet will implement this method to clean stuck pods.