...

Package inject

import "github.com/chaos-mesh/chaos-mesh/pkg/webhook/inject"
Overview
Index

Overview ▾

Constants

const (
    // StatusInjected is the annotation value for /status that indicates an injection was already performed on this pod
    StatusInjected = "injected"
)

func Inject

func Inject(res *v1.AdmissionRequest, cli client.Client, cfg *config.Config, controllerCfg *controllerCfg.ChaosControllerConfig, metrics *metrics.ChaosControllerManagerMetricsCollector) *v1.AdmissionResponse

Inject do pod template config inject

func MergeCommands

func MergeCommands(inject []string, origin []string, args []string) []string

MergeCommands merges injected commands and original commands for injecting commands to containers, eg: inject: []string{"bash", "-c", "/check.sh"}, origin: []string{"bash", "-c", "/run.sh"} merged commands: []string{"/bin/sh", "-ec", "/check.sh\n/run.sh"}