controller

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobNameSyncLogs           = "sync-logs"
	JobNameAddLogStream       = "add-log-stream"
	JobNameRemoveLogStream    = "remove-log-stream"
	JobNameCheckPodData       = "check-pod-data"
	JobNameDumpResourcePrefix = "dump"
)
View Source
const (
	ResyncTime = time.Second * 5
)

todo: decrease syn-log frequency

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Options
	// contains filtered or unexported fields
}

todo: move job handling into job.go

func NewController

func NewController(
	kubeclientset kubernetes.Interface,
	dynamicclientset dynamic.Interface,
	opts Options,
) (*Controller, error)

func (*Controller) Start

func (controller *Controller) Start(nWorkers int, expr filter.Expression) error

func (*Controller) Stop

func (controller *Controller) Stop() error

type HandleKind

type HandleKind string
const (
	HandleAdd    HandleKind = "Add"
	HandleUpdate HandleKind = "Edit"
	HandleDelete HandleKind = "Delete"
)

type Job

type Job struct {
	// contains filtered or unexported fields
}

func NewJob

func NewJob(ctx context.Context, name string, fn func()) Job

NewJob creates a processing job and appends a UUID to the end of the given name to add uniqueness to debuging output.

type LogStreamOptions

type LogStreamOptions struct {
	Pod           *apicorev1.Pod
	Container     *apicorev1.Container
	Context       context.Context
	KubeClientSet kubernetes.Interface
	BasePath      string
	Timeout       time.Duration
}

type Options

type Options struct {
	BasePath       string
	ParentContext  context.Context
	Logger         *slog.Logger
	LogSyncTimeout time.Duration
	Resources      []schema.GroupVersionResource
}

type Stream

type Stream interface {
	// Sync new data from stream source into stream destination.
	Sync() error

	// Close the streamer.
	Close() error
}

func NewLogStream

func NewLogStream(opts LogStreamOptions) (Stream, error)

Jump to

Keyboard shortcuts

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