introspection

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package introspection detects the cluster-level provider (e.g. "eks", "openshift-rhcos") on the elected leader and publishes it for lock-free reads by the DatadogAgent reconciler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Detector

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

Detector detects the cluster provider on the elected leader and publishes the result for lock-free reads.

func NewDetector

func NewDetector(mgr manager.Manager, nodeName string, logger logr.Logger, nodeCacheEnabled bool) *Detector

NewDetector builds a provider Detector from the manager. nodeName is the operator's own node (DD_HOSTNAME); empty skips the Stage-1 read. The Stage-2 cluster-node-list fallback is wired only when nodeCacheEnabled is true.

func (*Detector) InGracePeriod

func (d *Detector) InGracePeriod(window time.Duration) bool

InGracePeriod reports whether the detector is still within its startup window on this leadership term, during which an absent signal should not be treated as final. A detector that has not started yet is always in the grace period.

func (*Detector) NeedLeaderElection

func (d *Detector) NeedLeaderElection() bool

NeedLeaderElection implements manager.LeaderElectionRunnable: detection runs only on the elected leader.

func (*Detector) Provider

func (d *Detector) Provider() (string, bool)

Provider returns the detected provider and whether detection has completed. It performs a single atomic load and is safe for the reconcile hot path.

func (*Detector) Start

func (d *Detector) Start(ctx context.Context) error

Start implements manager.Runnable. It records the leader-start time, retries the initial detection with bounded backoff until it succeeds, then re-detects periodically. It returns when ctx is cancelled (leadership lost or shutdown).

func (*Detector) StartedAt

func (d *Detector) StartedAt() (time.Time, bool)

StartedAt returns the leader-start time and whether Start has run this term.

Jump to

Keyboard shortcuts

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