controller

package
v0.21.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	OCIUsernameKey     = "OCI_USERNAME"
	OCIPasswordKey     = "OCI_PASSWORD"
	OCIAccessTokenKey  = "OCI_ACCESS_TOKEN"
	OCIRefreshTokenKey = "OCI_REFRESH_TOKEN" // #nosec G101

)

Variables

This section is empty.

Functions

func CopyOCIStore added in v0.16.0

func CopyOCIStore(ctx context.Context, url string, version string, store *mapStore, credential *auth.Credential) error

CopyOCIStore collects artifacts from the provider OCI url and creates a map of file contents.

func FetchOCI added in v0.16.0

func FetchOCI(ctx context.Context, provider operatorv1.GenericProvider, cred *auth.Credential) (*mapStore, error)

FetchOCI copies the content of OCI.

func NewMapStore added in v0.16.0

func NewMapStore(p operatorv1.GenericProvider) mapStore

NewMapStore initializes mapStore for the provider resource.

func OCIAuthentication added in v0.16.0

func OCIAuthentication(c configclient.VariablesClient) *auth.Credential

OCIAuthentication returns user supplied credentials from provider variables.

func OCIConfigMap added in v0.16.0

func OCIConfigMap(ctx context.Context, provider operatorv1.GenericProvider, auth *auth.Credential) (*corev1.ConfigMap, error)

OCIConfigMap templates config from the OCI source.

func ProviderCacheName added in v0.21.0

func ProviderCacheName(provider operatorv1.GenericProvider) string

func ProviderLabels added in v0.16.0

func ProviderLabels(provider operatorv1.GenericProvider) map[string]string

ProviderLabels returns default set of labels that identify a config map with downloaded manifests.

func RepositoryConfigMap added in v0.16.0

func RepositoryConfigMap(ctx context.Context, provider operatorv1.GenericProvider, repo repository.Repository) (*corev1.ConfigMap, error)

RepositoryConfigMap templates ConfigMap resource from the provider repository.

func TemplateManifestsConfigMap added in v0.16.0

func TemplateManifestsConfigMap(provider operatorv1.GenericProvider, labels map[string]string, metadata, components []byte, compress bool) (*corev1.ConfigMap, error)

TemplateManifestsConfigMap prepares a config map with downloaded manifests.

Types

type ConfigMapRepositoryOption added in v0.20.0

type ConfigMapRepositoryOption interface {
	ApplyToConfigMapRepository(*ConfigMapRepositorySettings)
}

type ConfigMapRepositorySettings added in v0.20.0

type ConfigMapRepositorySettings struct {
	repository.Repository
	// contains filtered or unexported fields
}

type GenericProviderReconciler

type GenericProviderReconciler struct {
	Provider                 genericprovider.GenericProvider
	ProviderList             genericprovider.GenericProviderList
	Client                   client.Client
	Config                   *rest.Config
	WatchConfigSecretChanges bool
	WatchCoreProviderChanges bool

	DeletePhases    []PhaseFn
	ReconcilePhases []PhaseFn
}

func (*GenericProviderReconciler) BuildWithManager added in v0.21.0

func (r *GenericProviderReconciler) BuildWithManager(ctx context.Context, mgr ctrl.Manager) (*ctrl.Builder, error)

func (*GenericProviderReconciler) Reconcile

func (r *GenericProviderReconciler) Reconcile(ctx context.Context, req reconcile.Request) (_ reconcile.Result, reterr error)

func (*GenericProviderReconciler) SetupWithManager

func (r *GenericProviderReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error

type InNamespace added in v0.20.0

type InNamespace string

func (InNamespace) ApplyToConfigMapRepository added in v0.20.0

func (i InNamespace) ApplyToConfigMapRepository(settings *ConfigMapRepositorySettings)

type PhaseError

type PhaseError struct {
	Reason   string
	Type     clusterv1.ConditionType
	Severity clusterv1.ConditionSeverity
	Err      error
}

PhaseError custom error type for phases.

func (*PhaseError) Error

func (p *PhaseError) Error() string

type PhaseFn added in v0.21.0

type PhaseFn func(context.Context) (*Result, error)

PhaseFn is a function that represent a phase of the reconciliation.

type PhaseReconciler added in v0.21.0

type PhaseReconciler struct {
	// contains filtered or unexported fields
}

PhaseReconciler holds all required information for interacting with clusterctl code and helps to iterate through provider reconciliation phases.

func NewPhaseReconciler added in v0.21.0

NewPhaseReconciler returns phase reconciler for the given provider.

func (*PhaseReconciler) ApplyFromCache added in v0.21.0

func (p *PhaseReconciler) ApplyFromCache(ctx context.Context) (*Result, error)

ApplyFromCache applies provider configuration from cache and returns true if the cache did not change.

func (*PhaseReconciler) Delete added in v0.21.0

func (p *PhaseReconciler) Delete(ctx context.Context) (*Result, error)

Delete deletes the provider components using clusterctl library.

func (*PhaseReconciler) DownloadManifests added in v0.21.0

func (p *PhaseReconciler) DownloadManifests(ctx context.Context) (*Result, error)

DownloadManifests downloads CAPI manifests from a url.

func (*PhaseReconciler) Fetch added in v0.21.0

func (p *PhaseReconciler) Fetch(ctx context.Context) (*Result, error)

Fetch fetches the provider components from the repository and processes all yaml manifests.

func (*PhaseReconciler) Finalize added in v0.21.0

func (p *PhaseReconciler) Finalize(ctx context.Context) (*Result, error)

Finalize applies combined hash to a configMap, in order to mark provider provisioning completed.

func (*PhaseReconciler) InitializePhaseReconciler added in v0.21.0

func (p *PhaseReconciler) InitializePhaseReconciler(ctx context.Context) (*Result, error)

InitializePhaseReconciler initializes phase reconciler.

func (*PhaseReconciler) Install added in v0.21.0

func (p *PhaseReconciler) Install(ctx context.Context) (*Result, error)

Install installs the provider components using clusterctl library.

func (*PhaseReconciler) Load added in v0.21.0

func (p *PhaseReconciler) Load(ctx context.Context) (*Result, error)

Load provider specific configuration into phaseReconciler object.

func (*PhaseReconciler) PreflightChecks added in v0.21.0

func (p *PhaseReconciler) PreflightChecks(ctx context.Context) (*Result, error)

PreflightChecks a wrapper around the preflight checks.

func (*PhaseReconciler) ReportStatus added in v0.21.0

func (p *PhaseReconciler) ReportStatus(_ context.Context) (*Result, error)

func (*PhaseReconciler) Store added in v0.21.0

func (p *PhaseReconciler) Store(ctx context.Context) (*Result, error)

Store stores the provider components in the cache.

func (*PhaseReconciler) Upgrade added in v0.21.0

func (p *PhaseReconciler) Upgrade(ctx context.Context) (*Result, error)

Upgrade ensure all the clusterctl CRDs are available before installing the provider, and update existing components if required.

type Result added in v0.21.0

type Result struct {
	// Requeue tells the Controller to requeue the reconcile key.  Defaults to false.
	Requeue bool

	// RequeueAfter if greater than 0, tells the Controller to requeue the reconcile key after the Duration.
	// Implies that Requeue is true, there is no need to set Requeue to true at the same time as RequeueAfter.
	RequeueAfter time.Duration

	// Completed indicates if this phase finalized the reconcile process.
	Completed bool
}

Result holds the result and error from a reconciliation phase.

func (*Result) IsZero added in v0.21.0

func (r *Result) IsZero() bool

type SkipComponents added in v0.20.0

type SkipComponents struct{}

func (SkipComponents) ApplyToConfigMapRepository added in v0.20.0

func (s SkipComponents) ApplyToConfigMapRepository(settings *ConfigMapRepositorySettings)

type WithAdditionalManifests added in v0.20.0

type WithAdditionalManifests string

func (WithAdditionalManifests) ApplyToConfigMapRepository added in v0.20.0

func (w WithAdditionalManifests) ApplyToConfigMapRepository(settings *ConfigMapRepositorySettings)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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