config

package
v0.127.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package config contains the operator's runtime configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithEncodeLevelFormat added in v0.100.0

func WithEncodeLevelFormat(s string) zapcore.LevelEncoder

Types

type Config

type Config struct {

	// TargetAllocatorImage represents the flag to override the OpenTelemetry TargetAllocator container image.
	TargetAllocatorImage string
	// OperatorOpAMPBridgeImage represents the flag to override the OpAMPBridge container image.
	OperatorOpAMPBridgeImage string
	// AutoInstrumentationPythonImage is the OpenTelemetry Python auto-instrumentation container image.
	AutoInstrumentationPythonImage string
	// CollectorImage represents the flag to override the OpenTelemetry Collector container image.
	CollectorImage string
	// CollectorConfigMapEntry represents the configuration file name for the collector. Immutable.
	CollectorConfigMapEntry string
	// CreateRBACPermissions is true when the operator can create RBAC permissions for SAs running a collector instance. Immutable.
	CreateRBACPermissions autoRBAC.Availability
	// EnableMultiInstrumentation is true when the operator supports multi instrumentation.
	EnableMultiInstrumentation bool
	// EnableApacheHttpdAutoInstrumentation is true when the operator supports ApacheHttpd auto instrumentation.
	EnableApacheHttpdInstrumentation bool
	// EnableDotNetAutoInstrumentation is true when the operator supports dotnet auto instrumentation.
	EnableDotNetInstrumentation bool
	// EnableGoAutoInstrumentation is true when the operator supports Go auto instrumentation.
	EnableGoAutoInstrumentation bool
	// EnableNginxAutoInstrumentation is true when the operator supports nginx auto instrumentation.
	EnableNginxAutoInstrumentation bool
	// EnablePythonAutoInstrumentation is true when the operator supports dotnet auto instrumentation.
	EnablePythonAutoInstrumentation bool
	// EnableNodeJSAutoInstrumentation is true when the operator supports dotnet auto instrumentation.
	EnableNodeJSAutoInstrumentation bool
	// EnableJavaAutoInstrumentation is true when the operator supports java auto instrumentation.
	EnableJavaAutoInstrumentation bool
	// AutoInstrumentationDotNetImage is the OpenTelemetry DotNet auto-instrumentation container image.
	AutoInstrumentationDotNetImage string
	// AutoInstrumentationGoImage is the OpenTelemetry Go auto-instrumentation container image.
	AutoInstrumentationGoImage string
	// AutoInstrumentationApacheHttpdImage is the OpenTelemetry ApacheHttpd auto-instrumentation container image.
	AutoInstrumentationApacheHttpdImage string
	// AutoInstrumentationNginxImage is the OpenTelemetry Nginx auto-instrumentation container image.
	AutoInstrumentationNginxImage string
	// TargetAllocatorConfigMapEntry represents the configuration file name for the TargetAllocator. Immutable.
	TargetAllocatorConfigMapEntry string
	// OperatorOpAMPBridgeImageConfigMapEntry represents the configuration file name for the OpAMPBridge. Immutable.
	OperatorOpAMPBridgeConfigMapEntry string
	// AutoInstrumentationNodeJSImage is the OpenTelemetry NodeJS auto-instrumentation container image.
	AutoInstrumentationNodeJSImage string
	// AutoInstrumentationJavaImage returns OpenTelemetry Java auto-instrumentation container image.
	AutoInstrumentationJavaImage string

	// OpenShiftRoutesAvailability represents the availability of the OpenShift Routes API.
	OpenShiftRoutesAvailability openshift.RoutesAvailability
	// PrometheusCRAvailability represents the availability of the Prometheus Operator CRDs.
	PrometheusCRAvailability prometheus.Availability
	// CertManagerAvailability represents the availability of the Cert-Manager.
	CertManagerAvailability certmanager.Availability
	// TargetAllocatorAvailability represents the availability of the TargetAllocator CRD.
	TargetAllocatorAvailability targetallocator.Availability
	// CollectorAvailability represents the availability of the OpenTelemetryCollector CRD.
	CollectorAvailability collector.Availability
	// IgnoreMissingCollectorCRDs is true if the operator can ignore missing OpenTelemetryCollector CRDs.
	IgnoreMissingCollectorCRDs bool
	// LabelsFilter Returns the filters converted to regex strings used to filter out unwanted labels from propagations.
	LabelsFilter []string
	// AnnotationsFilter Returns the filters converted to regex strings used to filter out unwanted labels from propagations.
	AnnotationsFilter []string
	// contains filtered or unexported fields
}

Config holds the static configuration for this operator.

func New

func New(opts ...Option) Config

New constructs a new configuration based on the given options.

type Option

type Option func(c *options)

Option represents one specific configuration option.

func WithAnnotationFilters added in v0.96.0

func WithAnnotationFilters(annotationFilters []string) Option

WithAnnotationFilters is additive if called multiple times. It works off of a few default filters to prevent unnecessary rollouts. The defaults include the following: * kubectl.kubernetes.io/last-applied-configuration.

func WithAutoInstrumentationApacheHttpdImage added in v0.78.0

func WithAutoInstrumentationApacheHttpdImage(s string) Option

func WithAutoInstrumentationDotNetImage added in v0.57.2

func WithAutoInstrumentationDotNetImage(s string) Option

func WithAutoInstrumentationGoImage added in v0.77.0

func WithAutoInstrumentationGoImage(s string) Option

func WithAutoInstrumentationJavaImage added in v0.41.0

func WithAutoInstrumentationJavaImage(s string) Option

func WithAutoInstrumentationNginxImage added in v0.86.0

func WithAutoInstrumentationNginxImage(s string) Option

func WithAutoInstrumentationNodeJSImage added in v0.41.1

func WithAutoInstrumentationNodeJSImage(s string) Option

func WithAutoInstrumentationPythonImage added in v0.41.1

func WithAutoInstrumentationPythonImage(s string) Option

func WithCertManagerAvailability added in v0.111.0

func WithCertManagerAvailability(cmAvl certmanager.Availability) Option

func WithCollectorConfigMapEntry

func WithCollectorConfigMapEntry(s string) Option

func WithCollectorImage

func WithCollectorImage(s string) Option

func WithEnableApacheHttpdInstrumentation added in v0.95.0

func WithEnableApacheHttpdInstrumentation(s bool) Option

func WithEnableDotNetInstrumentation added in v0.96.0

func WithEnableDotNetInstrumentation(s bool) Option

func WithEnableGoInstrumentation added in v0.99.0

func WithEnableGoInstrumentation(s bool) Option

func WithEnableJavaInstrumentation added in v0.99.0

func WithEnableJavaInstrumentation(s bool) Option

func WithEnableMultiInstrumentation added in v0.95.0

func WithEnableMultiInstrumentation(s bool) Option

func WithEnableNginxInstrumentation added in v0.97.0

func WithEnableNginxInstrumentation(s bool) Option

func WithEnableNodeJSInstrumentation added in v0.99.0

func WithEnableNodeJSInstrumentation(s bool) Option

func WithEnablePythonInstrumentation added in v0.97.0

func WithEnablePythonInstrumentation(s bool) Option

func WithIgnoreMissingCollectorCRDs added in v0.125.0

func WithIgnoreMissingCollectorCRDs(b bool) Option

func WithLabelFilters added in v0.48.0

func WithLabelFilters(labelFilters []string) Option

func WithLogger

func WithLogger(logger logr.Logger) Option

func WithOpenShiftRoutesAvailability added in v0.90.0

func WithOpenShiftRoutesAvailability(os openshift.RoutesAvailability) Option

func WithOperatorOpAMPBridgeConfigMapEntry added in v0.88.0

func WithOperatorOpAMPBridgeConfigMapEntry(s string) Option

func WithOperatorOpAMPBridgeImage added in v0.70.0

func WithOperatorOpAMPBridgeImage(s string) Option

func WithPrometheusCRAvailability added in v0.97.1

func WithPrometheusCRAvailability(pcrd prometheus.Availability) Option

func WithRBACPermissions added in v0.100.0

func WithRBACPermissions(rAuto autoRBAC.Availability) Option

func WithTargetAllocatorConfigMapEntry added in v0.33.0

func WithTargetAllocatorConfigMapEntry(s string) Option

func WithTargetAllocatorImage added in v0.33.0

func WithTargetAllocatorImage(s string) Option

func WithVersion

func WithVersion(v version.Version) Option

type TLSConfig added in v0.125.0

type TLSConfig struct {
	MinVersion   string
	CipherSuites []string
}

func (TLSConfig) ApplyTLSConfig added in v0.125.0

func (tlsOpt TLSConfig) ApplyTLSConfig(cfg *tls.Config) error

ApplyTLSConfig get the option from command argument (tlsConfig), check the validity through k8s apiflag and set the config for webhook server. refer to https://pkg.go.dev/k8s.io/component-base/cli/flag

Jump to

Keyboard shortcuts

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