config

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	sync.RWMutex
	AnnotationNamespace string
	Injections          map[string][]*InjectionConfig
}

Config is a struct indicating how a given injection should be configured

func NewConfigWatcherConf

func NewConfigWatcherConf() *Config

NewConfigWatcherConf creates a configuration for watcher

func (*Config) GetRequestedConfig

func (c *Config) GetRequestedConfig(namespace, key string) (*InjectionConfig, error)

GetRequestedConfig returns the InjectionConfig given a requested key

func (*Config) ReplaceInjectionConfigs

func (c *Config) ReplaceInjectionConfigs(updatedConfigs map[string][]*InjectionConfig)

ReplaceInjectionConfigs will update the injection configs.

func (*Config) RequestAnnotationKey

func (c *Config) RequestAnnotationKey() string

func (*Config) RequestInitAnnotationKey

func (c *Config) RequestInitAnnotationKey() string

func (*Config) StatusAnnotationKey

func (c *Config) StatusAnnotationKey() string

type ExecAction

type ExecAction struct {
	// Command is the command line to execute inside the container, the working directory for the
	// command  is root ('/') in the container's filesystem. The command is simply exec'd, it is
	// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
	// a shell, you need to explicitly call out to that shell.
	// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
	// +optional
	Command []string `json:"command,omitempty"`
}

ExecAction describes a "run in container" action.

type InjectionConfig

type InjectionConfig struct {
	Name string
	// Selector is used to select pods that are used to inject sidecar.
	Selector *v1alpha1.SelectorSpec

	Containers            []corev1.Container   `json:"containers"`
	Volumes               []corev1.Volume      `json:"volumes"`
	Environment           []corev1.EnvVar      `json:"env"`
	VolumeMounts          []corev1.VolumeMount `json:"volumeMounts"`
	HostAliases           []corev1.HostAlias   `json:"hostAliases"`
	InitContainers        []corev1.Container   `json:"initContainers"`
	ShareProcessNamespace bool                 `json:"shareProcessNamespace"`
	// PostStart is called after a container is created first.
	// If the handler fails, the containers will failed.
	// Key defines for the name of deployment container.
	// Value defines for the Commands for stating container.
	// +optional
	PostStart map[string]ExecAction `json:"postStart,omitempty"`
}

InjectionConfig is a specific instance of an injected config, for a given annotation

type TemplateArgs

type TemplateArgs struct {
	Namespace string
	Name      string `yaml:"name"`
	// Name of the template
	Template  string            `yaml:"template"`
	Arguments map[string]string `yaml:"arguments"`
	// Selector is used to select pods that are used to inject sidecar.
	Selector *v1alpha1.SelectorSpec `json:"selector,omitempty"`
}

TemplateArgs is a set of arguments to render template

func LoadTemplateArgs

func LoadTemplateArgs(reader io.Reader) (*TemplateArgs, error)

LoadTemplateArgs takes an io.Reader and parses out an template args

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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