controller

package
v0.0.0-...-33942d2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const CleanFinalizer = "cleanup"

CleanFinalizer calls the "OnDelete" function for resource

View Source
const ReleaseOrphanResourcesFinalizer = "release-orphan-resources"

ReleaseOrphanResourcesFinalizer removes the metadata for anything this repo created

View Source
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

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.

func (*RepositoryController) Run

func (rc *RepositoryController) Run(ctx context.Context, workerCount int)

Run starts the 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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