compare

package
v0.0.0-...-bc898c7 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	SkippedRotationString  = "Skipped"
	SilentRotationString   = "Silent"
	InPlaceRotationString  = "InPlace"
	GracefulRotationString = "Graceful"
	EnforcedRotationString = "EnforcedSkipped"
)

Variables

This section is empty.

Functions

func Diff

func Diff[T interface{}](spec, status *T) (specData, statusData, diff string, outErr error)

Types

type Checksum

type Checksum[T interface{}] func(in *T) (string, error)

type Func

type Func func(builder api.ActionBuilder) (mode Mode, plan api.Plan, err error)

func Merge

func Merge(f ...Func) Func

type FuncGen

type FuncGen[T interface{}] func(spec, status *T) Func

type FuncGenP0

type FuncGenP0[T interface{}] func(in GenP0[T]) Func

func NewFuncGenP0

func NewFuncGenP0[T interface{}](spec, status *T) FuncGenP0[T]

type FuncGenP2

type FuncGenP2[T, P1, P2 interface{}] func(in GenP2[T, P1, P2]) Func

func NewFuncGenP2

func NewFuncGenP2[T, P1, P2 interface{}](p1 P1, p2 P2, spec, status *T) FuncGenP2[T, P1, P2]

type GenP0

type GenP0[T interface{}] func(spec, status *T) Func

type GenP2

type GenP2[T, P1, P2 interface{}] func(p1 P1, p2 P2, spec, status *T) Func

func ArrayExtractorP2

func ArrayExtractorP2[T, P1, P2 interface{}](gens ...GenP2[T, P1, P2]) GenP2[[]T, P1, P2]

func SubElementsP2

func SubElementsP2[T1, T2, P1, P2 interface{}](extractor SubElementExtractor[T1, T2], gens ...GenP2[T2, P1, P2]) GenP2[T1, P1, P2]

type Mode

type Mode int
const (
	SkippedRotation Mode = iota
	// SilentRotation Propagates changes without restart. Returned plan is executed in High actions
	SilentRotation
	// InPlaceRotation Silently accept changes. Returned plan is executed in Normal actions
	InPlaceRotation
	// GracefulRotation Schedule pod restart. Returned plan is ignored
	GracefulRotation
	// EnforcedRotation Enforce pod restart. Returned plan is ignored
	EnforcedRotation
)

func Evaluate

func Evaluate(builder api.ActionBuilder, f ...Func) (mode Mode, plan api.Plan, err error)

func P0

func P0[T interface{}](
	log logging.Logger,
	actionBuilder api.ActionBuilder,
	checksum Checksum[T],
	spec, status Template[T],
	evaluators ...GenP0[T]) (mode Mode, plan api.Plan, err error)

P0 runs compare of the provided templates without generic parameters

func P2

func P2[T interface{}, P1, P2 interface{}](
	log logging.Logger,
	p1 P1, p2 P2,
	actionBuilder api.ActionBuilder,
	checksum Checksum[T],
	spec, status Template[T],
	evaluators ...GenP2[T, P1, P2]) (mode Mode, plan api.Plan, err error)

P2 runs compare of the provided templates with 2 generic parameters

func (Mode) And

func (m Mode) And(b Mode) Mode

And returns the higher value of the rotation mode.

func (Mode) Func

func (m Mode) Func() Func

func (Mode) String

func (m Mode) String() string

type SubElementExtractor

type SubElementExtractor[T1, T2 interface{}] func(in *T1) *T2

type Template

type Template[T interface{}] interface {
	GetTemplate() *T
	GetChecksum() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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