Documentation ¶
Index ¶
- Constants
- func Add(ctx context.Context, c *config.CompletedConfig, mgr manager.Manager) error
- func Format(format string, args ...interface{}) string
- func GetNextPatches(yas *unitv1alpha1.YurtAppSet) map[string]YurtAppSetPatches
- func GetYurtAppSetCondition(status unitv1alpha1.YurtAppSetStatus, ...) *unitv1alpha1.YurtAppSetCondition
- func NewYurtAppSetCondition(condType unitv1alpha1.YurtAppSetConditionType, status corev1.ConditionStatus, ...) *unitv1alpha1.YurtAppSetCondition
- func RemoveYurtAppSetCondition(status *unitv1alpha1.YurtAppSetStatus, ...)
- func SetYurtAppSetCondition(status *unitv1alpha1.YurtAppSetStatus, ...)
- type ControlInterface
- type Pool
- type PoolControl
- func (m *PoolControl) CreatePool(yas *alpha1.YurtAppSet, poolName string, revision string, replicas int32) error
- func (m *PoolControl) DeletePool(pool *Pool) error
- func (m *PoolControl) GetAllPools(yas *alpha1.YurtAppSet) (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, yas *alpha1.YurtAppSet, revision string, replicas int32) error
- type PoolSpec
- type PoolStatus
- type ReconcileYurtAppSet
- type ResourceRef
- type YurtAppSetPatches
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 YurtAppSet 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(yas *unitv1alpha1.YurtAppSet) map[string]YurtAppSetPatches
func GetYurtAppSetCondition ¶
func GetYurtAppSetCondition(status unitv1alpha1.YurtAppSetStatus, condType unitv1alpha1.YurtAppSetConditionType) *unitv1alpha1.YurtAppSetCondition
GetYurtAppSetCondition returns the condition with the provided type.
func NewYurtAppSetCondition ¶
func NewYurtAppSetCondition(condType unitv1alpha1.YurtAppSetConditionType, status corev1.ConditionStatus, reason, message string) *unitv1alpha1.YurtAppSetCondition
NewYurtAppSetCondition creates a new YurtAppSet condition.
func RemoveYurtAppSetCondition ¶
func RemoveYurtAppSetCondition(status *unitv1alpha1.YurtAppSetStatus, condType unitv1alpha1.YurtAppSetConditionType)
RemoveYurtAppSetCondition removes the YurtAppSet condition with the provided type.
func SetYurtAppSetCondition ¶
func SetYurtAppSetCondition(status *unitv1alpha1.YurtAppSetStatus, condition *unitv1alpha1.YurtAppSetCondition)
SetYurtAppSetCondition updates the YurtAppSet 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 YurtAppSet. GetAllPools(yas *unitv1alpha1.YurtAppSet) ([]*Pool, error) // CreatePool creates the pool depending on the inputs. CreatePool(yas *unitv1alpha1.YurtAppSet, unit string, revision string, replicas int32) error // UpdatePool updates the target pool with the input information. UpdatePool(pool *Pool, yas *unitv1alpha1.YurtAppSet, 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 YurtAppSet status. GetPoolFailure(*Pool) *string // IsExpected check the pool is the expected revision IsExpected(pool *Pool, revision string) bool }
ControlInterface defines the interface that YurtAppSet 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 YurtAppSet.
type PoolControl ¶
PoolControl provides pool operations of MutableSet.
func (*PoolControl) CreatePool ¶
func (m *PoolControl) CreatePool(yas *alpha1.YurtAppSet, 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(yas *alpha1.YurtAppSet) (pools []*Pool, err error)
GetAllPools returns all of pools owned by the YurtAppSet.
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, yas *alpha1.YurtAppSet, 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 AvailableCondition v1.ConditionStatus }
PoolStatus stores the observed state of the Pool.
type ReconcileYurtAppSet ¶
ReconcileYurtAppSet reconciles a YurtAppSet object
type ResourceRef ¶
ResourceRef stores the Pool resource it represents.