drift

package
v0.0.0-...-bac2f6a Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DetectionManager

type DetectionManager struct {
	Client          client.Client
	Scheme          *runtime.Scheme
	Log             logr.Logger
	Notifier        Notifier
	MetricsRecorder MetricsRecorder
}

DetectionManager handles drift detection and remediation

func NewDetectionManager

func NewDetectionManager(client client.Client, scheme *runtime.Scheme, log logr.Logger) *DetectionManager

NewDetectionManager creates a new drift detection manager

func (*DetectionManager) CalculateChecksum

func (m *DetectionManager) CalculateChecksum(obj *unstructured.Unstructured) string

CalculateChecksum calculates a checksum for a resource

func (*DetectionManager) CheckDrift

CheckDrift checks for drift in the platform resources

func (*DetectionManager) StoreDriftHistory

func (m *DetectionManager) StoreDriftHistory(
	ctx context.Context,
	platform *observabilityv1.ObservabilityPlatform,
	report *DriftReport,
) error

StoreDriftHistory stores drift detection history

type DriftReport

type DriftReport struct {
	Platform         string
	Namespace        string
	CheckTime        time.Time
	DriftDetected    bool
	DriftedResources []gitopsv1beta1.DriftedResource
	Remediation      *RemediationReport
}

DriftReport represents a drift detection report

type MetricsRecorder

type MetricsRecorder interface {
	RecordDriftDetected(platform, resource string, driftType string)
	RecordDriftRemediated(platform, resource string, success bool)
	RecordDriftCheckDuration(platform string, duration time.Duration)
}

MetricsRecorder records drift metrics

type Notifier

type Notifier interface {
	NotifyDrift(ctx context.Context, drift *DriftReport) error
}

Notifier sends drift notifications

type RemediationReport

type RemediationReport struct {
	Attempted       bool
	Success         bool
	FailedResources []string
	Error           error
}

RemediationReport represents remediation results

Jump to

Keyboard shortcuts

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