injector

package
v1.1.190 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// AnnotationEnableInjection is an annotation used to enable injection of the heist agent into a Pod.
	AnnotationEnableInjection = "heist.youniqx.com/inject-agent"

	// AnnotationAgentStatus is an annotation used by the heist operator to keep track of the injection status in Pods.
	AnnotationAgentStatus = "heist.youniqx.com/agent-status"

	// AnnotationAgentImage is an annotation used to customize the injected agent image.
	AnnotationAgentImage = "heist.youniqx.com/agent-image"

	// AnnotationAgentPreload is an annotation used to customize whether an
	// InitContainer is created to make sure the secret is there before the
	// main container starts.
	AnnotationAgentPreload = "heist.youniqx.com/agent-preload"

	// AnnotationAgentMountPaths is an annotation used to customize paths where secrets can be written.
	AnnotationAgentMountPaths = "heist.youniqx.com/agent-paths"

	// AgentStatusInjected is the value of the AnnotationAgentStatus annotation when the agent has already been injected.
	AgentStatusInjected = "injected"
)

Variables

This section is empty.

Functions

func Component

func Component(config *Config) operator.Component

func EscapeJSONPointer

func EscapeJSONPointer(s string) string

Types

type Config

type Config struct {
	AgentImage string
	OpenShift  bool
}

type Handler

type Handler struct {
	Log           logr.Logger
	VaultAPI      vault.API
	K8sClient     client.Client
	Filter        operator.AnnotationFilter
	VaultAddress  string
	AuthMountPath string
	Config        *Config
}

func (*Handler) Mutate

func (h *Handler) Mutate(req *v1.AdmissionRequest) *v1.AdmissionResponse

Mutate takes an admission request and performs mutation if necessary, returning the final API response.

func (*Handler) NewInjector

func (h *Handler) NewInjector(pod *corev1.Pod) (injector *Injector, err error)

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Handler) ShouldInject

func (h *Handler) ShouldInject(pod *corev1.Pod) (bool, error)

type Injector

type Injector struct {
	Pod            *corev1.Pod
	MountPaths     []string
	Config         *Config
	PreloadSecrets bool
}

func (*Injector) Patch

func (i *Injector) Patch() ([]*jsonpatch.JsonPatchOperation, error)

Jump to

Keyboard shortcuts

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