config

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxIterations = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Inject []*Inject `yaml:"inject,omitempty"`
	K8S    K8S       `yaml:"k8s"`
	Log    Log       `yaml:"log"`
	Server Server    `yaml:"server"`

	Version string
}

func ReadFrom

func ReadFrom(file string) (
	*Config, error,
)

type Inject

type Inject struct {
	Name string `yaml:"name,omitempty"`

	MaxIterations int `yaml:"maxIterations,omitempty"`

	LabelSelector     *InjectLabelSelector `yaml:"labelSelector,omitempty"`
	NamespaceSelector *InjectLabelSelector `yaml:"namespaceSelector,omitempty"`

	Labels map[string]string `yaml:"labels,omitempty"`

	Affinity     *InjectAffinity     `yaml:"affinity,omitempty"`
	Containers   []InjectContainer   `yaml:"containers,omitempty"`
	Tolerations  []InjectToleration  `yaml:"tolerations,omitempty"`
	VolumeMounts []InjectVolumeMount `yaml:"volumeMounts,omitempty"`
	Volumes      []InjectVolume      `yaml:"volumes,omitempty"`
}

func (Inject) Fingerprint

func (i Inject) Fingerprint() string

type InjectAffinity added in v0.0.14

type InjectAffinity struct {
	NodeAffinity *InjectNodeAffinity `yaml:"nodeAffinity,omitempty"`
}

func (InjectAffinity) Affinity added in v0.0.14

func (a InjectAffinity) Affinity() (*core_v1.Affinity, error)

type InjectContainer

type InjectContainer struct {
	Name string `yaml:"name,omitempty"`

	Image   string   `yaml:"image,omitempty"`
	Command []string `yaml:"command,omitempty"`
	Args    []string `yaml:"args,omitempty"`

	Ports        []InjectContainerPort                `yaml:"ports,omitempty"`
	Resources    *InjectContainerResourceRequirements `yaml:"resources,omitempty"`
	VolumeMounts []InjectVolumeMount                  `yaml:"volumeMounts,omitempty"`
}

func (InjectContainer) Container

func (c InjectContainer) Container() (*core_v1.Container, error)

type InjectContainerPort

type InjectContainerPort struct {
	Name          string `yaml:"name,omitempty"`
	HostPort      int32  `yaml:"hostPort,omitempty"`
	ContainerPort int32  `yaml:"containerPort,omitempty"`
	Protocol      string `yaml:"protocol,omitempty"`
	HostIP        string `yaml:"hostIP,omitempty"`
}

type InjectContainerResourceRequirements

type InjectContainerResourceRequirements struct {
	Limits   map[string]string `yaml:"limits,omitempty"`
	Requests map[string]string `yaml:"requests,omitempty"`
}

func (InjectContainerResourceRequirements) ResourceRequirements

type InjectLabelSelector

type InjectLabelSelector struct {
	MatchLabels      map[string]string       `yaml:"matchLabels,omitempty"`
	MatchExpressions []InjectMatchExpression `yaml:"matchExpressions,omitempty"`
}

func (InjectLabelSelector) LabelSelector

func (ls InjectLabelSelector) LabelSelector() (*meta_v1.LabelSelector, error)

type InjectMatchExpression

type InjectMatchExpression struct {
	Key      string   `yaml:"key,omitempty"`
	Operator string   `yaml:"operator,omitempty"`
	Values   []string `yaml:"values,omitempty"`
}

type InjectNodeAffinity added in v0.0.14

type InjectNodeAffinity struct {
	RequiredDuringSchedulingIgnoredDuringExecution *InjectRequiredDuringSchedulingIgnoredDuringExecution `yaml:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"`
}

func (InjectNodeAffinity) NodeAffinity added in v0.0.14

func (na InjectNodeAffinity) NodeAffinity() (*core_v1.NodeAffinity, error)

type InjectNodeSelectorTerm added in v0.0.14

type InjectNodeSelectorTerm struct {
	MatchExpressions []InjectMatchExpression `yaml:"matchExpressions,omitempty"`
	MatchFields      []InjectMatchExpression `yaml:"matchFields,omitempty"`
}

func (InjectNodeSelectorTerm) NodeSelectorTerm added in v0.0.14

func (nst InjectNodeSelectorTerm) NodeSelectorTerm() (*core_v1.NodeSelectorTerm, error)

type InjectRequiredDuringSchedulingIgnoredDuringExecution added in v0.0.14

type InjectRequiredDuringSchedulingIgnoredDuringExecution struct {
	NodeSelectorTerms []InjectNodeSelectorTerm `yaml:"nodeSelectorTerms"`
}

type InjectToleration added in v0.0.14

type InjectToleration struct {
	Key               string `yaml:"key,omitempty"`
	Operator          string `yaml:"operator,omitempty"`
	Value             string `yaml:"value,omitempty"`
	Effect            string `yaml:"effect,omitempty"`
	TolerationSeconds *int64 `yaml:"tolerationSeconds,omitempty"`
}

func (InjectToleration) Toleration added in v0.0.14

func (t InjectToleration) Toleration() (*core_v1.Toleration, error)

type InjectVolume

type InjectVolume struct {
	Name string `yaml:"name,omitempty"`

	ConfigMap *InjectVolumeConfigMap `yaml:"configMap,omitempty"`
}

func (InjectVolume) Volume

func (v InjectVolume) Volume() (*core_v1.Volume, error)

type InjectVolumeConfigMap

type InjectVolumeConfigMap struct {
	Name string `yaml:"name,omitempty"`

	DefaultMode *int32                  `yaml:"defaultMode,omitempty"`
	Items       []InjectVolumeKeyToPath `yaml:"items,omitempty"`
	Optional    *bool                   `yaml:"optional,omitempty"`
}

func (InjectVolumeConfigMap) ConfigMapVolumeSource

func (vcm InjectVolumeConfigMap) ConfigMapVolumeSource() (*core_v1.ConfigMapVolumeSource, error)

type InjectVolumeKeyToPath

type InjectVolumeKeyToPath struct {
	Key  string `yaml:"key"`
	Path string `yaml:"path"`
	Mode *int32 `yaml:"mode"`
}

type InjectVolumeMount

type InjectVolumeMount struct {
	Name string `yaml:"name"`

	MountPath   string `yaml:"mountPath"`
	SubPath     string `yaml:"subPath,omitempty"`
	SubPathExpr string `yaml:"subPathExpr,omitempty"`

	ReadOnly          bool    `yaml:"readOnly,omitempty"`
	RecursiveReadOnly *string `yaml:"recursiveReadOnly,omitempty"`

	MountPropagation *string `yaml:"mountPropagation,omitempty"`
}

func (InjectVolumeMount) VolumeMount

func (vm InjectVolumeMount) VolumeMount() (*core_v1.VolumeMount, error)

type K8S

type K8S struct {
	Namespace                        string `yaml:"namespace,omitempty"`
	ServiceName                      string `yaml:"serviceName,omitempty"`
	ServicePortNumber                int32  `yaml:"servicePortNumber,omitempty"`
	MutatingWebhookConfigurationName string `yaml:"mutatingWebhookConfigurationName,omitempty"`
}

type Log

type Log struct {
	Level string `yaml:"level,omitempty"`
	Mode  string `yaml:"mode,omitempty"`
}

type Server

type Server struct {
	ListenAddress   string `yaml:"listenAddress,omitempty"`
	PathHealthcheck string `yaml:"patchHealthcheck,omitempty"`
	PathWebhook     string `yaml:"patchWebhook,omitempty"`
}

Jump to

Keyboard shortcuts

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