infrastructure

package
v1.42.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultAddOptions are the default AddOptions for AddToManager.
	DefaultAddOptions = AddOptions{
		DisableProjectedTokenMount: true,
	}
)
View Source
var (
	// NewAzureClientFactory initializes a new AzureClientFactory. Exposed for testing.
	NewAzureClientFactory = newAzureClientFactory
)
View Source
var OnRestore = OnDelete

OnRestore decides the reconciler used on migration.

Functions

func AddToManager

func AddToManager(ctx context.Context, mgr manager.Manager) error

AddToManager adds a controller with the default AddOptions.

func AddToManagerWithOptions

func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, options AddOptions) error

AddToManagerWithOptions adds a controller with the given AddOptions to the given manager. The opts.Reconciler is being set with a newly instantiated actuator.

func CleanupTerraformerResources added in v1.40.0

func CleanupTerraformerResources(ctx context.Context, tf terraformer.Terraformer) error

CleanupTerraformerResources deletes terraformer artifacts (config, state, secrets).

func HasFlowAnnotation added in v1.40.0

func HasFlowAnnotation(infrastructure *extensionsv1alpha1.Infrastructure, cluster *controller.Cluster) bool

HasFlowAnnotation returns true if the new flow reconciler should be used for the reconciliation.

func NewActuator

func NewActuator(mgr manager.Manager, disableProjectedTokenMount bool) infrastructure.Actuator

NewActuator creates a new infrastructure.Actuator.

func NoOpStateInitializer added in v1.15.2

func NoOpStateInitializer(_ context.Context, _ client.Client, _, _ string, _ *metav1.OwnerReference) error

NoOpStateInitializer is a no-op StateConfigMapInitializerFunc.

func OnDelete added in v1.40.0

OnDelete returns true if the operation should use the Flow deletion for the given cluster.

func OnReconcile added in v1.40.0

func OnReconcile(infra *extensionsv1alpha1.Infrastructure, cluster *extensions.Cluster) (bool, error)

OnReconcile returns true if the operation should use the Flow for the given cluster.

Types

type AddOptions

type AddOptions struct {
	// Controller are the controller.Options.
	Controller controller.Options
	// IgnoreOperationAnnotation specifies whether to ignore the operation annotation or not.
	IgnoreOperationAnnotation bool
	// DisableProjectedTokenMount specifies whether the projected token mount shall be disabled for the terraformer.
	// Used for testing only.
	DisableProjectedTokenMount bool
}

AddOptions are options to apply when adding the Azure infrastructure controller to the manager.

type FlowReconciler added in v1.40.0

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

FlowReconciler an implementation of an infrastructure reconciler using native SDKs.

func (*FlowReconciler) Delete added in v1.40.0

Delete deletes the infrastructure resource using the flow reconciler.

func (*FlowReconciler) Reconcile added in v1.40.0

Reconcile reconciles the infrastructure and returns the status (state of the world), the state (input for the next loops) and any errors that occurred.

func (*FlowReconciler) Restore added in v1.40.0

Restore implements the restoration of an infrastructure resource during the control plane migration.

type Reconciler added in v1.40.0

type Reconciler interface {
	// Reconcile manages infrastructure resources according to desired spec.
	Reconcile(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, cluster *controller.Cluster) error
	// Delete removes any created infrastructure resource on the provider.
	Delete(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, cluster *controller.Cluster) error
	// Restore restores the infrastructure after a control plane migration. Effectively it performs a recovery of data from the infrastructure.status.state and
	// proceeds to reconcile.
	Restore(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, cluster *controller.Cluster) error
}

Reconciler is an interface for the infrastructure reconciliation.

func NewFlowReconciler added in v1.40.0

func NewFlowReconciler(a *actuator, log logr.Logger, projToken bool) (Reconciler, error)

NewFlowReconciler creates a new flow reconciler.

func NewTerraformReconciler added in v1.40.0

func NewTerraformReconciler(a *actuator, logger logr.Logger, restConfig *rest.Config, disableProjectedTokenMount bool) (Reconciler, error)

NewTerraformReconciler creates a new TerraformReconciler

type ReconcilerFactory added in v1.40.0

type ReconcilerFactory interface {
	Build(useFlow bool) (Reconciler, error)
}

ReconcilerFactory can construct the different infrastructure reconciler implementations.

type ReconcilerFactoryImpl added in v1.40.0

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

ReconcilerFactoryImpl is an implementation of a ReconcilerFactory

func (ReconcilerFactoryImpl) Build added in v1.40.0

func (f ReconcilerFactoryImpl) Build(useFlow bool) (Reconciler, error)

Build builds the Reconciler according to the arguments.

type SelectorFunc added in v1.40.0

SelectorFunc decides the reconciler used.

func (SelectorFunc) Select added in v1.40.0

func (s SelectorFunc) Select(infrastructure *extensionsv1alpha1.Infrastructure, cluster *extensions.Cluster) (bool, error)

Select selects the reconciler implementation.

type StrategySelector added in v1.40.0

type StrategySelector interface {
	Select(infrastructure *extensionsv1alpha1.Infrastructure, cluster *extensions.Cluster) (bool, error)
}

StrategySelector decides the reconciler used.

type TerraformReconciler added in v1.40.0

type TerraformReconciler struct {
	Client     client.Client
	Logger     logr.Logger
	RestConfig *rest.Config
	// contains filtered or unexported fields
}

TerraformReconciler can reconcile infrastructure objects using Terraform.

func (*TerraformReconciler) Delete added in v1.40.0

Delete removes any created infrastructure resource on the provider.

func (*TerraformReconciler) Reconcile added in v1.40.0

Reconcile manages infrastructure resources according to desired spec.

func (*TerraformReconciler) Restore added in v1.40.0

Restore restores the infrastructure after a control plane migration. Effectively it performs a recovery of data from the infrastructure.status.state and proceeds to reconcile.

Directories

Path Synopsis
Package infrastructure is a generated GoMock package.
Package infrastructure is a generated GoMock package.

Jump to

Keyboard shortcuts

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