operator

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package operator contains main implementation of Flatcar Linux Update Operator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Kubernetes client.
	Client kubernetes.Interface
	// Annotations to look for before and after reboots.
	BeforeRebootAnnotations []string
	AfterRebootAnnotations  []string
	// Reboot window.
	RebootWindowStart    string
	RebootWindowLength   string
	Namespace            string
	LockID               string
	LockType             string
	ReconciliationPeriod time.Duration
	LeaderElectionLease  time.Duration
	MaxRebootingNodes    int
}

Config configures a Kontroller.

type Kontroller

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

Kontroller implement operator part of FLUO.

func New

func New(config Config) (*Kontroller, error)

New initializes a new Kontroller.

func (*Kontroller) Run

func (k *Kontroller) Run(stop <-chan struct{}) error

Run starts the operator reconcilitation process and runs until the stop channel is closed.

type Period added in v0.9.0

type Period struct {
	Start time.Time
	End   time.Time
}

Period is a span of time from Start to End.

type Periodic added in v0.9.0

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

Periodic keeps track of a repeating period of time.

func ParsePeriodic added in v0.9.0

func ParsePeriodic(start, duration string) (*Periodic, error)

ParsePeriodic returns a Periodic specified as a start and duration.

func (*Periodic) DurationToStart added in v0.9.0

func (pc *Periodic) DurationToStart(ref time.Time) time.Duration

DurationToStart returns the duration between the supplied time and the start of Periodic's relevant period. If we're in a period, a value <= 0 is returned, indicating how deep into period we are. If we're outside a period, a value > 0 is returned, indicating how long before the next period starts.

func (*Periodic) Next added in v0.9.0

func (pc *Periodic) Next(ref time.Time) *Period

Next returns Periodic's next Period occurrence relative to ref.

func (*Periodic) Previous added in v0.9.0

func (pc *Periodic) Previous(ref time.Time) *Period

Previous returns Periodic's previous Period occurrence relative to ref.

Jump to

Keyboard shortcuts

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