yurtappset

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 32 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

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 Format

func Format(format string, args ...interface{}) string

func GetNextPatches

func GetNextPatches(yas *unitv1alpha1.YurtAppSet) map[string]YurtAppSetPatches

func GetYurtAppSetCondition

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

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

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 PoolSpec

type PoolSpec struct {
	PoolRef metav1.Object
}

PoolSpec stores the spec details of the 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

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

ReconcileYurtAppSet reconciles a YurtAppSet object

func (*ReconcileYurtAppSet) Reconcile

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

type ResourceRef

type ResourceRef struct {
	Resources []metav1.Object
}

ResourceRef stores the Pool resource it represents.

type YurtAppSetPatches

type YurtAppSetPatches struct {
	Replicas int32
	Patch    string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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