config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Path string

Path indicates the config file path

Functions

func LoadConfig

func LoadConfig() error

LoadConfig loads the config from the file

func SetPath

func SetPath(path string)

SetPath sets the config file path

Types

type MutatorConfig

type MutatorConfig struct {
	AnnotationKey string      `json:"annotationKey" yaml:"annotationKey"`
	Strategies    []*Strategy `json:"strategies" yaml:"strategies"`
	Rules         []*Rule     `json:"rules" yaml:"rules"`
}

MutatorConfig indicates the kubemutator main config file structure

var CurrentConfig *MutatorConfig

CurrentConfig indicates the current running config

type Patch

type Patch struct {
	Data       string `json:"data" yaml:"data"`
	IsTemplate bool   `json:"isTemplate" yaml:"isTemplate"`
	IsArray    bool   `json:"isArray" yaml:"isArray"`
}

Patch indicates each patch

type Rule

type Rule struct {
	Namespace  []string              `json:"namespace" yaml:"namespace"`
	Selector   *metav1.LabelSelector `json:"selector" yaml:"selector"`
	Strategies []string              `json:"strategies" yaml:"strategies"`
	// contains filtered or unexported fields
}

Rule indicates each select rule

func (*Rule) Matches

func (r *Rule) Matches(l map[string]string) bool

Matches returns if the selector matches the labels

type Strategy

type Strategy struct {
	Name    string  `json:"name" yaml:"name"`
	Patches []Patch `json:"patches" yaml:"patches"`
}

Strategy indicates each strategy

Jump to

Keyboard shortcuts

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