Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigureCheckout(cs *CheckoutState) *pvpoolv1alpha1obj.Checkout
- func ConfigurePool(ps *PoolState) *pvpoolv1alpha1obj.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" )
View Source
const (
CheckoutReclaimPolicyAnnotationKey = "pvpool.puppet.com/checkout.reclaim-policy"
)
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(pvpoolv1alpha1validation.MountJobMaxBackoffLimit), } )
View Source
var DependencyManager = ownerext.NewManager("pvpool.puppet.com/owner")
Functions ¶
func ConfigureCheckout ¶
func ConfigureCheckout(cs *CheckoutState) *pvpoolv1alpha1obj.Checkout
func ConfigurePool ¶
func ConfigurePool(ps *PoolState) *pvpoolv1alpha1obj.Pool
Types ¶
type CheckoutState ¶
type CheckoutState struct { Checkout *pvpoolv1alpha1obj.Checkout // PersistentVolumeClaim is the final, settled PVC that should be made // available to the requestor. 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 // LockedPersistentVolumeClaim is a PVC that we use to take a PV from the // pool for this checkout. This PVC is necessary if we need to perform // modifications to the underlying PV before we can present it to the // requestor (for example, setting fields on the volume source). // // Using this intermediate means the somewhat complicated logic to detect // whether a pool replica has become stale can be left alone while we mess // with the PV here instead. LockedPersistentVolumeClaim *corev1obj.PersistentVolumeClaim // LockedPersistentVolume is the PV corresponding to the locked PVC, i.e., // the original PV from the pool. LockedPersistentVolume *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 *pvpoolv1alpha1obj.Checkout) *CheckoutState
type PoolReplica ¶
type PoolReplica struct { Pool *pvpoolv1alpha1obj.Pool PersistentVolumeClaim *corev1obj.PersistentVolumeClaim PersistentVolume *corev1obj.PersistentVolume InitJob *batchv1obj.Job }
func ApplyPoolReplica ¶
func ApplyPoolReplica(ctx context.Context, cl client.Client, p *pvpoolv1alpha1obj.Pool, id string) (*PoolReplica, error)
func ConfigurePoolReplica ¶
func ConfigurePoolReplica(pr *PoolReplica) *PoolReplica
func NewPoolReplica ¶
func NewPoolReplica(p *pvpoolv1alpha1obj.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 *pvpoolv1alpha1obj.Pool Initializing PoolReplicas Available PoolReplicas Stale PoolReplicas // Conds represent status updates for given conditions. Conds map[pvpoolv1alpha1.PoolConditionType]pvpoolv1alpha1.Condition }
func ConfigurePoolState ¶
func NewPoolState ¶
func NewPoolState(p *pvpoolv1alpha1obj.Pool) *PoolState
Click to show internal directories.
Click to hide internal directories.