relabel

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Update(obj metaV1.Object)
}

Action applies a change to an object.

type ActionConfig

type ActionConfig interface {
	// ToAction constructs an action
	ToAction() Action
}

ActionConfig is a config object that can construct an action.

type Condition

type Condition interface {
	Satisfies(obj metaV1.Object) bool
}

Condition checks if we should modify an object.

type ConditionConfig

type ConditionConfig interface {
	// ToCondition constructs a condition
	ToCondition() Condition
}

ConditionConfig is a config object that can construct a condition.

type Relabeler

type Relabeler interface {
	Evaluate(originalRawObject []byte, obj metaV1.Object) ([]jsonpatch.Operation, error)
}

Relabeler is the main entrypoint into the relabeling process it keeps a runtime optimized set of rules to relabel objects.

func NewRelabeler

func NewRelabeler(rules []Rule) Relabeler

type Rule

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

Rule is a single rule describing if and how we should relabel an object.

func NewRelabelRule

func NewRelabelRule(name string, conditions []Condition, actions []Action) *Rule

func (*Rule) Evaluate

func (r *Rule) Evaluate(obj metaV1.Object, logger *slog.Logger) bool

Evaluate a k8s object against this rule return if the object was modified.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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