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"}, }, }, { Name: "RemoteMachineCleanup", Dependencies: []CRDDependency{ {GroupVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Resource: "remotemachines", Description: "K0smotron RemoteMachine"}, }, }, { Name: "RemoteMachineWebhook", Dependencies: []CRDDependency{ {GroupVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Resource: "remotemachines", Description: "K0smotron RemoteMachine"}, }, }, }
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.