auto

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnnotateKey

func AnnotateKey(instType instrumentation.Type) string

AnnotateKey joins the auto-annotate annotation prefix with the provided instrumentation.Type.

Types

type AnnotationConfig

type AnnotationConfig struct {
	Java   AnnotationResources `json:"java"`
	Python AnnotationResources `json:"python"`
}

AnnotationConfig details the resources that have enabled auto-annotation for each instrumentation type.

type AnnotationMutators

type AnnotationMutators struct {
	// contains filtered or unexported fields
}

AnnotationMutators contains functions that can be used to mutate annotations on all supported objects based on the configured mutators.

func NewAnnotationMutators

func NewAnnotationMutators(
	clientWriter client.Writer,
	clientReader client.Reader,
	logger logr.Logger,
	cfg AnnotationConfig,
	typeSet instrumentation.TypeSet,
) *AnnotationMutators

NewAnnotationMutators creates mutators based on the AnnotationConfig provided and enabled instrumentation.TypeSet. The default mutator, which is used for non-configured resources, removes all auto-annotated annotations in the type set.

func (*AnnotationMutators) MutateAndPatchAll

func (m *AnnotationMutators) MutateAndPatchAll(ctx context.Context)

MutateAndPatchAll runs the mutators for each of the supported resources and patches them.

func (*AnnotationMutators) MutateObject

func (m *AnnotationMutators) MutateObject(obj client.Object) (any, bool)

MutateObject modifies annotations for a single object using the configured mutators.

func (*AnnotationMutators) RestartNamespace

func (m *AnnotationMutators) RestartNamespace(ctx context.Context, namespace *corev1.Namespace, mutatedAnnotations map[string]string)

RestartNamespace sets the restartedAtAnnotation for each of the namespace's supported resources and patches them.

type AnnotationResources

type AnnotationResources struct {
	Namespaces   []string `json:"namespaces,omitempty"`
	Deployments  []string `json:"deployments,omitempty"`
	DaemonSets   []string `json:"daemonsets,omitempty"`
	StatefulSets []string `json:"statefulsets,omitempty"`
}

AnnotationResources contains slices of resource names for each of the supported workloads.

Jump to

Keyboard shortcuts

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