mutator

package
v2.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DomainPrefix           = "telepresence.getambassador.io/"
	InjectAnnotation       = DomainPrefix + "inject-" + agentconfig.ContainerName
	ServiceNameAnnotation  = DomainPrefix + "inject-service-name"
	ManualInjectAnnotation = DomainPrefix + "manually-injected"
)

Variables

View Source
var NewAgentInjectorFunc = NewAgentInjector //nolint:gochecknoglobals // extension point
View Source
var NewWatcherFunc = NewWatcher //nolint:gochecknoglobals // extension point

Functions

func RegenerateAgentMaps

func RegenerateAgentMaps(ctx context.Context, agentImage string) error

RegenerateAgentMaps load the telepresence-agents config map, regenerates all entries in it, and then, if any of the entries changed, it updates the map.

func ServeMutator

func ServeMutator(ctx context.Context) error

Types

type AgentInjector added in v2.17.0

type AgentInjector interface {
	Inject(ctx context.Context, req *admission.AdmissionRequest) (p PatchOps, err error)
	Uninstall(ctx context.Context)
}

func NewAgentInjector added in v2.17.0

func NewAgentInjector(ctx context.Context, agentConfigs Map) AgentInjector

NewAgentInjector creates a new agentInjector.

type Map

type Map interface {
	Get(string, string) (agentconfig.SidecarExt, error)
	Run(context.Context) error
	Delete(context.Context, string, string) error
	Store(context.Context, agentconfig.SidecarExt, bool) error
	DeleteMapsAndRolloutAll(ctx context.Context)
}

func Load

func Load(ctx context.Context) (m Map, err error)

func NewWatcher

func NewWatcher(name string, namespaces ...string) Map

type PatchOperation added in v2.17.0

type PatchOperation struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value any    `json:"value,omitempty"`
}

JSON patch, see https://tools.ietf.org/html/rfc6902 .

type PatchOps added in v2.17.0

type PatchOps []PatchOperation

func (PatchOps) String added in v2.17.0

func (p PatchOps) String() string

Directories

Path Synopsis
Package mock_kubernetes is a generated GoMock package.
Package mock_kubernetes is a generated GoMock package.

Jump to

Keyboard shortcuts

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