Documentation ¶
Index ¶
- Constants
- func Add(mgr manager.Manager, _ context.Context) error
- func GetNextPatches(ud *unitv1alpha1.UnitedDeployment) map[string]UnitedDeploymentPatches
- func GetUnitedDeploymentCondition(status unitv1alpha1.UnitedDeploymentStatus, ...) *unitv1alpha1.UnitedDeploymentCondition
- func NewUnitedDeploymentCondition(condType unitv1alpha1.UnitedDeploymentConditionType, ...) *unitv1alpha1.UnitedDeploymentCondition
- func RemoveUnitedDeploymentCondition(status *unitv1alpha1.UnitedDeploymentStatus, ...)
- func SetUnitedDeploymentCondition(status *unitv1alpha1.UnitedDeploymentStatus, ...)
- type ControlInterface
- type Pool
- type PoolControl
- func (m *PoolControl) CreatePool(ud *alpha1.UnitedDeployment, poolName string, revision string, replicas int32) error
- func (m *PoolControl) DeletePool(pool *Pool) error
- func (m *PoolControl) GetAllPools(ud *alpha1.UnitedDeployment) (pools []*Pool, err error)
- func (m *PoolControl) GetPoolFailure(pool *Pool) *string
- func (m *PoolControl) IsExpected(pool *Pool, revision string) bool
- func (m *PoolControl) UpdatePool(pool *Pool, ud *alpha1.UnitedDeployment, revision string, replicas int32) error
- type PoolSpec
- type PoolStatus
- type ReconcileUnitedDeployment
- type ResourceRef
- type UnitedDeploymentPatches
Constants ¶
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 ¶
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 GetNextPatches ¶
func GetNextPatches(ud *unitv1alpha1.UnitedDeployment) map[string]UnitedDeploymentPatches
func GetUnitedDeploymentCondition ¶
func GetUnitedDeploymentCondition(status unitv1alpha1.UnitedDeploymentStatus, condType unitv1alpha1.UnitedDeploymentConditionType) *unitv1alpha1.UnitedDeploymentCondition
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 ¶
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 PoolStatus ¶
type PoolStatus struct { ObservedGeneration int64 adapter.ReplicasInfo PatchInfo string }
PoolStatus stores the observed state of the Pool.
type ReconcileUnitedDeployment ¶
ReconcileUnitedDeployment reconciles a UnitedDeployment object
func (*ReconcileUnitedDeployment) Reconcile ¶
func (r *ReconcileUnitedDeployment) Reconcile(_ context.Context, request reconcile.Request) (reconcile.Result, error)
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 ¶
ResourceRef stores the Pool resource it represents.