Documentation
¶
Index ¶
- Constants
- type HealthChecker
- func (hc *HealthChecker) HasRecentFailure(healthStatus provisioning.HealthStatus, ...) bool
- func (hc *HealthChecker) RecordFailure(ctx context.Context, failureType provisioning.HealthFailureType, err error, ...) error
- func (hc *HealthChecker) RefreshHealth(ctx context.Context, repo repository.Repository) (*provisioning.TestResults, provisioning.HealthStatus, error)
- func (hc *HealthChecker) RefreshTimestamp(ctx context.Context, repo *provisioning.Repository) error
- func (hc *HealthChecker) ShouldCheckHealth(repo *provisioning.Repository) bool
- type RepositoryController
- type StatusPatcher
Constants ¶
const CleanFinalizer = "cleanup"
CleanFinalizer calls the "OnDelete" function for resource
const ReleaseOrphanResourcesFinalizer = "release-orphan-resources"
ReleaseOrphanResourcesFinalizer removes the metadata for anything this repo created
const RemoveOrphanResourcesFinalizer = "remove-orphan-resources"
RemoveOrphanResourcesFinalizer removes everything this repo created
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HealthChecker ¶
type HealthChecker struct {
// contains filtered or unexported fields
}
HealthChecker provides unified health checking for repositories
func NewHealthChecker ¶
func NewHealthChecker(statusPatcher StatusPatcher) *HealthChecker
NewHealthChecker creates a new health checker
func (*HealthChecker) HasRecentFailure ¶
func (hc *HealthChecker) HasRecentFailure(healthStatus provisioning.HealthStatus, failureType provisioning.HealthFailureType) bool
HasRecentFailure checks if there's a recent failure of a specific type
func (*HealthChecker) RecordFailure ¶
func (hc *HealthChecker) RecordFailure(ctx context.Context, failureType provisioning.HealthFailureType, err error, repo *provisioning.Repository) error
RecordFailureAndUpdate records a failure and updates the repository status
func (*HealthChecker) RefreshHealth ¶
func (hc *HealthChecker) RefreshHealth(ctx context.Context, repo repository.Repository) (*provisioning.TestResults, provisioning.HealthStatus, error)
RefreshHealth performs a health check on an existing repository, updates its status if needed, and returns the test results
func (*HealthChecker) RefreshTimestamp ¶
func (hc *HealthChecker) RefreshTimestamp(ctx context.Context, repo *provisioning.Repository) error
RefreshTimestamp updates the health status timestamp without changing other fields
func (*HealthChecker) ShouldCheckHealth ¶
func (hc *HealthChecker) ShouldCheckHealth(repo *provisioning.Repository) bool
ShouldCheckHealth determines if a repository health check should be performed
type RepositoryController ¶
type RepositoryController struct {
// contains filtered or unexported fields
}
RepositoryController controls how and when CRD is established.
func NewRepositoryController ¶
func NewRepositoryController( provisioningClient client.ProvisioningV0alpha1Interface, repoInformer informer.RepositoryInformer, repoFactory repository.Factory, resourceLister resources.ResourceLister, clients resources.ClientFactory, jobs jobs.Queue, dualwrite dualwrite.Service, healthChecker *HealthChecker, statusPatcher StatusPatcher, ) (*RepositoryController, error)
NewRepositoryController creates new RepositoryController.
type StatusPatcher ¶
type StatusPatcher interface {
Patch(ctx context.Context, repo *provisioning.Repository, patchOperations ...map[string]interface{}) error
}
StatusPatcher defines the interface for updating repository status