backfiller

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Package backfiller provides functionality to backfill Kubernetes Resource objects, and if enabled invokes the webhook domain logic

Index

Constants

View Source
const (
	MaxWorkersPerPool     = 10
	MaxConnectionAttempts = 10 // The most amount of sleep time possible across all attempts is 1033 seconds (approximately 17 minutes and 13 seconds).
	ConnectionTimeout     = 5 * time.Second
)

Variables

This section is empty.

Functions

func AwaitCollectorService

func AwaitCollectorService(ctx context.Context, endpoint string, maxRetries int, timeout time.Duration) error

AwaitCollectorService attempts to send a WriteRequest to the specified collector service endpoint using an HTTP POST request. It retries the request up to a specified number of times with exponential backoff and jitter in case of failures.

func AwaitWebhookService

func AwaitWebhookService(ctx context.Context, namespace, serviceName string, maxRetries int, timeout time.Duration) error

AwaitWebhookService waits for the webhook service to be ready by sending validation requests. It retries the validation for a specified number of attempts with exponential backoff and jitter.

Types

type BackFillJobDescription

type BackFillJobDescription[T metav1.Object] struct {
	Convert ObjectConverter[T] // Function to convert an object to the desired type
	List    ListFunc           // Function to list resources of this type
	// contains filtered or unexported fields
}

BackFillJobDescription represents a job description for backfilling resources. It includes the group, version, kind of the resource, a converter function, and a list function.

type KubernetesObjectEnumerator

type KubernetesObjectEnumerator interface {
	// Start begins the enumeration process for Kubernetes objects.
	// It takes a context for managing cancellation and deadlines.
	Start(ctx context.Context) error

	// DisableServiceWait disables the waiting mechanism for dependent services.
	// This can be useful for testing or scenarios where waiting is not required.
	DisableServiceWait()
}

KubernetesObjectEnumerator defines the interface for enumerating Kubernetes objects. It provides methods to start the enumeration process and to disable the waiting mechanism for dependent services, which can be useful for testing or specific scenarios.

func NewKubernetesObjectEnumerator

func NewKubernetesObjectEnumerator(k8sClient kubernetes.Interface, controller webhook.WebhookController, settings *config.Settings) KubernetesObjectEnumerator

type ListFunc

type ListFunc func(namespace string, opts metav1.ListOptions) (metav1.ListInterface, error)

ListFunc is a type alias for a function that lists resources in a namespace with specific list options.

type ObjectConverter

type ObjectConverter[T metav1.Object] func(o any) T

ObjectConverter is a type alias for a function that converts an object of any type to a specific metav1.Object type.

Jump to

Keyboard shortcuts

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