Documentation
¶
Index ¶
- type DetectionManager
- func (m *DetectionManager) CalculateChecksum(obj *unstructured.Unstructured) string
- func (m *DetectionManager) CheckDrift(ctx context.Context, platform *observabilityv1.ObservabilityPlatform, ...) (*DriftReport, error)
- func (m *DetectionManager) StoreDriftHistory(ctx context.Context, platform *observabilityv1.ObservabilityPlatform, ...) error
- type DriftReport
- type MetricsRecorder
- type Notifier
- type RemediationReport
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 ¶
func (m *DetectionManager) CheckDrift( ctx context.Context, platform *observabilityv1.ObservabilityPlatform, gitOps *gitopsv1beta1.GitOpsIntegrationSpec, desiredState map[string]*unstructured.Unstructured, ) (*DriftReport, error)
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
Click to show internal directories.
Click to hide internal directories.