app

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

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

func ConfigurePool(ps *PoolState) *obj.Pool

func UpdateCondition

func UpdateCondition(prev, next v1alpha1.Condition) v1alpha1.Condition

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

func (*CheckoutState) Load

func (cs *CheckoutState) Load(ctx context.Context, cl client.Client) (bool, error)

func (*CheckoutState) Persist

func (cs *CheckoutState) Persist(ctx context.Context, cl client.Client) error

type PoolReplica

type PoolReplica struct {
	Pool                  *obj.Pool
	PersistentVolumeClaim *corev1obj.PersistentVolumeClaim
	PersistentVolume      *corev1obj.PersistentVolume
	InitJob               *batchv1obj.Job
}

func ApplyPoolReplica

func ApplyPoolReplica(ctx context.Context, cl client.Client, p *obj.Pool, id string) (*PoolReplica, error)

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) Load

func (pr *PoolReplica) Load(ctx context.Context, cl client.Client) (bool, error)

func (*PoolReplica) Persist

func (pr *PoolReplica) Persist(ctx context.Context, cl client.Client) 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 (PoolReplicasSortByCreationTimestamp) Less

func (PoolReplicasSortByCreationTimestamp) Swap

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 ConfigurePoolState(ps *PoolState) *PoolState

func NewPoolState

func NewPoolState(p *obj.Pool) *PoolState

func (*PoolState) Delete

func (ps *PoolState) Delete(ctx context.Context, cl client.Client, opts ...lifecycle.DeleteOption) (bool, error)

func (*PoolState) Load

func (ps *PoolState) Load(ctx context.Context, cl client.Client) (bool, error)

func (*PoolState) Persist

func (ps *PoolState) Persist(ctx context.Context, cl client.Client) error

Jump to

Keyboard shortcuts

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