preflight

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OperatorDependencies = []ControllerDependencies{
	{
		Name: "Colony",
		Dependencies: []CRDDependency{
			{GroupVersion: "k0rdent.mirantis.com/v1beta1", Resource: "clusterdeployments", Description: "K0rdent ClusterDeployment"},
		},
	},
}

OperatorDependencies defines the CRD requirements for each controller.

Functions

This section is empty.

Types

type CRDDependency

type CRDDependency struct {
	GroupVersion string // e.g. "k0rdent.mirantis.com/v1beta1"
	Resource     string // e.g. "clusterdeployments"
	Description  string // human-readable name, e.g. "K0rdent ClusterDeployment"
}

CRDDependency describes a single CRD that a controller requires.

type CheckOptions

type CheckOptions struct {
	MaxRetries     int
	InitialBackoff time.Duration
	MaxBackoff     time.Duration
}

CheckOptions configures the retry behavior for CRD discovery.

func DefaultCheckOptions

func DefaultCheckOptions() CheckOptions

DefaultCheckOptions returns sensible defaults: 5 retries, 2s→15s backoff.

type CheckResult

type CheckResult struct {
	Name      string
	Available bool
	Missing   []CRDDependency
}

CheckResult reports whether a controller's CRD dependencies are satisfied.

func CheckCRDsAvailable

func CheckCRDsAvailable(
	ctx context.Context,
	cfg *rest.Config,
	deps []ControllerDependencies,
	opts CheckOptions,
	logger logr.Logger,
) ([]CheckResult, error)

CheckCRDsAvailable uses the Kubernetes Discovery API to verify which CRDs are present in the cluster. It retries with backoff to handle CRDs that are still being installed (e.g. by Helm subcharts).

type ControllerDependencies

type ControllerDependencies struct {
	Name         string
	Dependencies []CRDDependency
}

ControllerDependencies maps a controller name to the CRDs it requires.

Jump to

Keyboard shortcuts

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