util

package
v0.0.0-...-9cb7711 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ConditionTypeAvailable ConditionType = "Available"
	ConditionTypeDegraded  ConditionType = "Degraded"

	ReasonSuccessfulInstrumentation    Reason = "SuccessfulInstrumentation"
	ReasonNoInstrumentationNecessary   Reason = "ReasonAlreadyInstrumented"
	ReasonFailedInstrumentation        Reason = "FailedInstrumentation"
	ReasonSuccessfulUninstrumentation  Reason = "SuccessfulUninstrumentation"
	ReasonNoUninstrumentationNecessary Reason = "ReasonAlreadyNotInstrumented"
	ReasonFailedUninstrumentation      Reason = "FailedUninstrumentation"
)

Variables

View Source
var (
	EmptyListOptions                          = metav1.ListOptions{}
	WorkloadsWithDash0InstrumentedLabelFilter = metav1.ListOptions{
		LabelSelector: instrumentedLabelKey,
	}
)

Functions

func AddInstrumentationLabels

func AddInstrumentationLabels(
	meta *metav1.ObjectMeta,
	instrumenationSuccess bool,
	instrumentationMetadata InstrumentationMetadata,
)

func AddWebhookIgnoreOnceLabel

func AddWebhookIgnoreOnceLabel(meta *metav1.ObjectMeta)

func CheckAndDeleteIgnoreOnceLabel

func CheckAndDeleteIgnoreOnceLabel(meta *metav1.ObjectMeta) bool

func HasBeenInstrumentedSuccessfully

func HasBeenInstrumentedSuccessfully(meta *metav1.ObjectMeta) bool

func HasBeenInstrumentedSuccessfullyByThisVersion

func HasBeenInstrumentedSuccessfullyByThisVersion(
	meta *metav1.ObjectMeta,
	images Images,
) bool

func HasOptedOutOfInstrumenation

func HasOptedOutOfInstrumenation(meta *metav1.ObjectMeta) bool

func HasOptedOutOfInstrumenationAndIsUninstrumented

func HasOptedOutOfInstrumenationAndIsUninstrumented(meta *metav1.ObjectMeta) bool

func ImageNameToLabel

func ImageNameToLabel(imageName string) string

func InstrumenationAttemptHasFailed

func InstrumenationAttemptHasFailed(meta *metav1.ObjectMeta) bool

func QueueFailedInstrumentationEvent

func QueueFailedInstrumentationEvent(eventRecorder record.EventRecorder, resource runtime.Object, eventSource string, err error)

func QueueFailedUninstrumentationEvent

func QueueFailedUninstrumentationEvent(eventRecorder record.EventRecorder, resource runtime.Object, eventSource string, err error)

func QueueNoInstrumentationNecessaryEvent

func QueueNoInstrumentationNecessaryEvent(eventRecorder record.EventRecorder, resource runtime.Object, eventSource string)

func QueueNoUninstrumentationNecessaryEvent

func QueueNoUninstrumentationNecessaryEvent(eventRecorder record.EventRecorder, resource runtime.Object, eventSource string)

func QueueSuccessfulInstrumentationEvent

func QueueSuccessfulInstrumentationEvent(eventRecorder record.EventRecorder, resource runtime.Object, eventSource string)

func QueueSuccessfulUninstrumentationEvent

func QueueSuccessfulUninstrumentationEvent(eventRecorder record.EventRecorder, resource runtime.Object, eventSource string)

func ReadOptOutSetting

func ReadOptOutSetting(setting *bool) bool

func ReadOptionalBooleanWithDefault

func ReadOptionalBooleanWithDefault(setting *bool, defaultValue bool) bool

func RemoveInstrumentationLabels

func RemoveInstrumentationLabels(meta *metav1.ObjectMeta)

func Retry

func Retry(operationLabel string, operation func() error, log *logr.Logger) error

func WasInstrumentedButHasOptedOutNow

func WasInstrumentedButHasOptedOutNow(meta *metav1.ObjectMeta) bool

Types

type ConditionType

type ConditionType string

type Images

type Images struct {
	OperatorImage                string
	InitContainerImage           string
	InitContainerImagePullPolicy corev1.PullPolicy
}

type InstrumentationMetadata

type InstrumentationMetadata struct {
	Images
	OtelCollectorBaseUrl string
	InstrumentedBy       string
}

type Reason

type Reason string

Jump to

Keyboard shortcuts

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