Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigureCheckout(cs *CheckoutState) *obj.Checkout
- func ConfigurePool(ps *PoolState) *obj.Pool
- func UpdateCondition(prev, next v1alpha1.Condition) v1alpha1.Condition
- type CheckoutState
- type PoolReplica
- func (pr *PoolReplica) Available() bool
- func (pr *PoolReplica) Delete(ctx context.Context, cl client.Client, opts ...lifecycle.DeleteOption) (bool, error)
- func (pr *PoolReplica) Load(ctx context.Context, cl client.Client) (bool, error)
- func (pr *PoolReplica) Persist(ctx context.Context, cl client.Client) error
- func (pr *PoolReplica) Stale() bool
- type PoolReplicas
- type PoolReplicasSortByCreationTimestamp
- type PoolState
Constants ¶
View Source
const ( PoolReplicaPhaseAnnotationKey = "pvpool.puppet.com/replica.phase" PoolReplicaPhaseAnnotationValueInitializing = "Initializing" PoolReplicaPhaseAnnotationValueAvailable = "Available" )
Variables ¶
View Source
var ( DefaultPoolReplicaInitJobSpec = batchv1.JobSpec{ Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ Containers: []corev1.Container{ { Name: "init", Image: "busybox@sha256:8d0c42425011ea3fb5b4ec5a121dde4ce986c2efea46be9d981a478fe1d206ec", }, }, }, }, BackoffLimit: pointer.Int32Ptr(validation.MountJobMaxBackoffLimit), } )
View Source
var DependencyManager = ownerext.NewManager("pvpool.puppet.com/owner")
Functions ¶
func ConfigureCheckout ¶
func ConfigureCheckout(cs *CheckoutState) *obj.Checkout
func ConfigurePool ¶
Types ¶
type CheckoutState ¶
type CheckoutState struct {
Checkout *obj.Checkout
PersistentVolumeClaim *corev1obj.PersistentVolumeClaim
// PersistentVolume is the PV corresponding to the PVC owned by this
// checkout. If this object exists, but not PersistentVolumeClaim, we merely
// need to set up the PVC to point at this PV.
PersistentVolume *corev1obj.PersistentVolume
// Conds represent status updates for given conditions.
Conds map[pvpoolv1alpha1.CheckoutConditionType]pvpoolv1alpha1.Condition
}
func ConfigureCheckoutState ¶
func ConfigureCheckoutState(cs *CheckoutState) (*CheckoutState, error)
func NewCheckoutState ¶
func NewCheckoutState(c *obj.Checkout) *CheckoutState
type PoolReplica ¶
type PoolReplica struct {
Pool *obj.Pool
PersistentVolumeClaim *corev1obj.PersistentVolumeClaim
PersistentVolume *corev1obj.PersistentVolume
InitJob *batchv1obj.Job
}
func ApplyPoolReplica ¶
func ConfigurePoolReplica ¶
func ConfigurePoolReplica(pr *PoolReplica) *PoolReplica
func NewPoolReplica ¶
func NewPoolReplica(p *obj.Pool, key client.ObjectKey) *PoolReplica
func (*PoolReplica) Available ¶
func (pr *PoolReplica) Available() bool
func (*PoolReplica) Delete ¶
func (pr *PoolReplica) Delete(ctx context.Context, cl client.Client, opts ...lifecycle.DeleteOption) (bool, error)
func (*PoolReplica) Stale ¶
func (pr *PoolReplica) Stale() bool
type PoolReplicas ¶
type PoolReplicas []*PoolReplica
func (*PoolReplicas) Pop ¶
func (prs *PoolReplicas) Pop(rng rand.Rand) (*PoolReplica, bool, error)
type PoolReplicasSortByCreationTimestamp ¶
type PoolReplicasSortByCreationTimestamp []*PoolReplica
func (PoolReplicasSortByCreationTimestamp) Len ¶
func (prs PoolReplicasSortByCreationTimestamp) Len() int
func (PoolReplicasSortByCreationTimestamp) Less ¶
func (prs PoolReplicasSortByCreationTimestamp) Less(i, j int) bool
func (PoolReplicasSortByCreationTimestamp) Swap ¶
func (prs PoolReplicasSortByCreationTimestamp) Swap(i, j int)
type PoolState ¶
type PoolState struct {
Pool *obj.Pool
Initializing PoolReplicas
Available PoolReplicas
Stale PoolReplicas
// Conds represent status updates for given conditions.
Conds map[pvpoolv1alpha1.PoolConditionType]pvpoolv1alpha1.Condition
}
func ConfigurePoolState ¶
func NewPoolState ¶
Click to show internal directories.
Click to hide internal directories.