Documentation ¶
Index ¶
- func AddJobStatus(existing []batchv1.JobStatus, status batchv1.JobStatus) []batchv1.JobStatus
- func BuildJobs(crd *cosmosalpha.StatefulJob) []*batchv1.Job
- func BuildPVCs(crd *cosmosalpha.StatefulJob, vs *snapshotv1.VolumeSnapshot) ([]*corev1.PersistentVolumeClaim, error)
- func DeletePredicate() predicate.Predicate
- func FindActiveJob(ctx context.Context, getter Getter, crd *cosmosalpha.StatefulJob) (bool, *batchv1.Job, error)
- func LabelSelectorPredicate() predicate.Predicate
- func ReadyForSnapshot(crd *cosmosalpha.StatefulJob, now time.Time) bool
- func ResourceName(crd *cosmosalpha.StatefulJob) string
- func UpdateJobStatus(existing []batchv1.JobStatus, status batchv1.JobStatus) []batchv1.JobStatus
- type CreateClient
- type Creator
- type Getter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddJobStatus ¶
AddJobStatus adds the status to the head of the list.
func BuildJobs ¶
func BuildJobs(crd *cosmosalpha.StatefulJob) []*batchv1.Job
BuildJobs returns jobs to compress and upload data to an object storage.
func BuildPVCs ¶
func BuildPVCs(crd *cosmosalpha.StatefulJob, vs *snapshotv1.VolumeSnapshot) ([]*corev1.PersistentVolumeClaim, error)
BuildPVCs builds PVCs given the crd and VolumeSnapshot.
func DeletePredicate ¶
DeletePredicate watches all delete events.
func FindActiveJob ¶
func FindActiveJob(ctx context.Context, getter Getter, crd *cosmosalpha.StatefulJob) (bool, *batchv1.Job, error)
FindActiveJob finds the currently active job in any state. A job is considered inactive if it cannot be found.
func LabelSelectorPredicate ¶
LabelSelectorPredicate returns a predicate matching default labels created by the operator.
func ReadyForSnapshot ¶
func ReadyForSnapshot(crd *cosmosalpha.StatefulJob, now time.Time) bool
ReadyForSnapshot returns true if enough time has passed to create a new snapshot.
func ResourceName ¶
func ResourceName(crd *cosmosalpha.StatefulJob) string
ResourceName is the name of all resources created by the controller.
Types ¶
type CreateClient ¶
type CreateClient interface { Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error Scheme() *runtime.Scheme }
CreateClient creates and sets owner reference.
type Creator ¶
Creator creates objects and assigns the owner reference.
func NewCreator ¶
func NewCreator[T client.Object](client CreateClient, builder func() ([]T, error)) Creator[T]
NewCreator returns a valid Creator.
func (Creator[T]) Create ¶
func (c Creator[T]) Create(ctx context.Context, crd *cosmosalpha.StatefulJob) error
Create builds the resources, creates them, and assigns owner reference.