reaper

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unit = time.Minute
)

Variables

View Source
var (
	Settings = &settings.Settings
	Log      = logr.WithName("reaper")
)

Functions

This section is empty.

Types

type BucketReaper

type BucketReaper struct {
	// DB
	DB *gorm.DB
}

BucketReaper bucket reaper.

func (*BucketReaper) Run

func (r *BucketReaper) Run()

Run Executes the reaper. A bucket is deleted when it is no longer referenced and the TTL has expired.

type FileReaper added in v0.1.0

type FileReaper struct {
	// DB
	DB *gorm.DB
}

FileReaper file reaper.

func (*FileReaper) Run added in v0.1.0

func (r *FileReaper) Run()

Run Executes the reaper. A file is deleted when it is no longer referenced and the TTL has expired.

type GroupReaper

type GroupReaper struct {
	// DB
	DB *gorm.DB
}

GroupReaper reaps task groups.

func (*GroupReaper) Run

func (r *GroupReaper) Run()

Run Executes the reaper. Rules by state:

Created
- Deleted after the defined period.
Ready (submitted)
- Deleted when all of its task have been deleted.
- Bucket is released immediately.

type Manager

type Manager struct {
	// DB
	DB *gorm.DB
	// k8s client.
	Client k8s.Client
}

Manager provides task management.

func (*Manager) Run

func (m *Manager) Run(ctx context.Context)

Run the manager.

type Reaper

type Reaper interface {
	Run()
}

Reaper interface.

type RefFinder added in v0.5.0

type RefFinder struct {
	// DB
	DB *gorm.DB
}

RefFinder provides model inspection for files tagged with:

ref:<kind>
[]ref:<kind>

func (*RefFinder) Find added in v0.5.0

func (r *RefFinder) Find(m any, kind string, ids map[uint]byte) (err error)

Find returns a map of all references for the model and kind.

type Task

type Task = task.Task

type TaskReaper

type TaskReaper struct {
	// DB
	DB *gorm.DB
	// k8s client.
	Client k8s.Client
}

TaskReaper reaps tasks.

func (*TaskReaper) Run

func (r *TaskReaper) Run()

Run Executes the reaper. Rules by state:

Created
- Deleted after TTL.Created > created timestamp or
  settings.Task.Reaper.Created.
Pending
- Deleted after TTL.Pending > created timestamp or
  settings.Task.Reaper.Created.
Postponed
- Deleted after TTL.Postponed > created timestamp or
  settings.Task.Reaper.Created.
Running
- Deleted after TTL.Running > started timestamp.
Succeeded
- Deleted after TTL > terminated timestamp or
  settings.Task.Reaper.Succeeded.
- Bucket is released after the defined period.
- Pod is deleted after the defined period.
Failed
- Deleted after TTL > terminated timestamp or
  settings.Task.Reaper.Failed.
- Bucket is released after the defined period.
- Pod is deleted after the defined period.

Jump to

Keyboard shortcuts

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