uniteddeployment

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const ControllerRevisionHashLabel = "controller.kubernetes.io/hash"

ControllerRevisionHashLabel is the label used to indicate the hash value of a ControllerRevision's Data.

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager, _ context.Context) error

Add creates a new UnitedDeployment Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller and Start it when the Manager is Started.

func GetNextReplicas

func GetNextReplicas(ud *unitv1alpha1.UnitedDeployment) map[string]int32

func GetUnitedDeploymentCondition

GetUnitedDeploymentCondition returns the condition with the provided type.

func NewUnitedDeploymentCondition

func NewUnitedDeploymentCondition(condType unitv1alpha1.UnitedDeploymentConditionType, status corev1.ConditionStatus, reason, message string) *unitv1alpha1.UnitedDeploymentCondition

NewUnitedDeploymentCondition creates a new UnitedDeployment condition.

func RemoveUnitedDeploymentCondition

func RemoveUnitedDeploymentCondition(status *unitv1alpha1.UnitedDeploymentStatus, condType unitv1alpha1.UnitedDeploymentConditionType)

RemoveUnitedDeploymentCondition removes the UnitedDeployment condition with the provided type.

func SetUnitedDeploymentCondition

func SetUnitedDeploymentCondition(status *unitv1alpha1.UnitedDeploymentStatus, condition *unitv1alpha1.UnitedDeploymentCondition)

SetUnitedDeploymentCondition updates the UnitedDeployment to include the provided condition. If the condition that we are about to add already exists and has the same status, reason and message then we are not going to update.

Types

type ControlInterface

type ControlInterface interface {
	// GetAllPools returns the pools which are managed by the UnitedDeployment.
	GetAllPools(ud *unitv1alpha1.UnitedDeployment) ([]*Pool, error)
	// CreatePool creates the pool depending on the inputs.
	CreatePool(ud *unitv1alpha1.UnitedDeployment, unit string, revision string, replicas int32) error
	// UpdatePool updates the target pool with the input information.
	UpdatePool(pool *Pool, ud *unitv1alpha1.UnitedDeployment, revision string, replicas int32) error
	// DeletePool is used to delete the input pool.
	DeletePool(*Pool) error
	// GetPoolFailure extracts the pool failure message to expose on UnitedDeployment status.
	GetPoolFailure(*Pool) *string
	// IsExpected check the pool is the expected revision
	IsExpected(pool *Pool, revision string) bool
}

ControlInterface defines the interface that UnitedDeployment uses to list, create, update, and delete Pools.

type Pool

type Pool struct {
	Name      string
	Namespace string
	Spec      PoolSpec
	Status    PoolStatus
}

Pool stores the details of a pool resource owned by one UnitedDeployment.

type PoolControl

type PoolControl struct {
	client.Client
	// contains filtered or unexported fields
}

PoolControl provides pool operations of MutableSet.

func (*PoolControl) CreatePool

func (m *PoolControl) CreatePool(ud *alpha1.UnitedDeployment, poolName string, revision string,
	replicas int32) error

CreatePool creates the Pool depending on the inputs.

func (*PoolControl) DeletePool

func (m *PoolControl) DeletePool(pool *Pool) error

DeletePool is called to delete the pool. The target Pool workload can be found with the input pool.

func (*PoolControl) GetAllPools

func (m *PoolControl) GetAllPools(ud *alpha1.UnitedDeployment) (pools []*Pool, err error)

GetAllPools returns all of pools owned by the UnitedDeployment.

func (*PoolControl) GetPoolFailure

func (m *PoolControl) GetPoolFailure(pool *Pool) *string

GetPoolFailure return the error message extracted form Pool workload status conditions.

func (*PoolControl) IsExpected

func (m *PoolControl) IsExpected(pool *Pool, revision string) bool

IsExpected checks the pool is expected revision or not.

func (*PoolControl) UpdatePool

func (m *PoolControl) UpdatePool(pool *Pool, ud *alpha1.UnitedDeployment, revision string, replicas int32) error

UpdatePool is used to update the pool. The target Pool workload can be found with the input pool.

type PoolSpec

type PoolSpec struct {
	PoolRef metav1.Object
}

PoolSpec stores the spec details of the Pool

type PoolStatus

type PoolStatus struct {
	ObservedGeneration int64
	adapter.ReplicasInfo
}

PoolStatus stores the observed state of the Pool.

type ReconcileUnitedDeployment

type ReconcileUnitedDeployment struct {
	client.Client
	// contains filtered or unexported fields
}

ReconcileUnitedDeployment reconciles a UnitedDeployment object

func (*ReconcileUnitedDeployment) Reconcile

Reconcile reads that state of the cluster for a UnitedDeployment object and makes changes based on the state read and what is in the UnitedDeployment.Spec

type ResourceRef

type ResourceRef struct {
	Resources []metav1.Object
}

ResourceRef stores the Pool resource it represents.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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