Documentation ¶
Index ¶
- Variables
- func AddToManager(ctx context.Context, mgr manager.Manager) error
- func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, options AddOptions) error
- func CleanupTerraformerResources(ctx context.Context, tf terraformer.Terraformer) error
- func HasFlowAnnotation(infrastructure *extensionsv1alpha1.Infrastructure, cluster *controller.Cluster) bool
- func NewActuator(mgr manager.Manager, disableProjectedTokenMount bool) infrastructure.Actuator
- func NoOpStateInitializer(_ context.Context, _ client.Client, _, _ string, _ *metav1.OwnerReference) error
- func OnDelete(infra *extensionsv1alpha1.Infrastructure, _ *extensions.Cluster) (bool, error)
- func OnReconcile(infra *extensionsv1alpha1.Infrastructure, cluster *extensions.Cluster) (bool, error)
- type AddOptions
- type FlowReconciler
- func (f *FlowReconciler) Delete(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, ...) error
- func (f *FlowReconciler) Reconcile(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, ...) error
- func (f *FlowReconciler) Restore(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, ...) error
- type Reconciler
- type ReconcilerFactory
- type ReconcilerFactoryImpl
- type SelectorFunc
- type StrategySelector
- type TerraformReconciler
- func (r *TerraformReconciler) Delete(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, ...) error
- func (r *TerraformReconciler) Reconcile(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, ...) error
- func (r *TerraformReconciler) Restore(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, ...) error
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultAddOptions are the default AddOptions for AddToManager. DefaultAddOptions = AddOptions{ DisableProjectedTokenMount: true, } )
var (
// NewAzureClientFactory initializes a new AzureClientFactory. Exposed for testing.
NewAzureClientFactory = newAzureClientFactory
)
var OnRestore = OnDelete
OnRestore decides the reconciler used on migration.
Functions ¶
func AddToManager ¶
AddToManager adds a controller with the default AddOptions.
func AddToManagerWithOptions ¶
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
func OnDelete(infra *extensionsv1alpha1.Infrastructure, _ *extensions.Cluster) (bool, error)
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
func (f *FlowReconciler) Delete(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, cluster *controller.Cluster) error
Delete deletes the infrastructure resource using the flow reconciler.
func (*FlowReconciler) Reconcile ¶ added in v1.40.0
func (f *FlowReconciler) Reconcile(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, cluster *controller.Cluster) error
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
func (f *FlowReconciler) Restore(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, cluster *controller.Cluster) error
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
type SelectorFunc func(*extensionsv1alpha1.Infrastructure, *extensions.Cluster) (bool, error)
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
func (r *TerraformReconciler) Delete(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, cluster *controller.Cluster) error
Delete removes any created infrastructure resource on the provider.
func (*TerraformReconciler) Reconcile ¶ added in v1.40.0
func (r *TerraformReconciler) Reconcile(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, cluster *controller.Cluster) error
Reconcile manages infrastructure resources according to desired spec.
func (*TerraformReconciler) Restore ¶ added in v1.40.0
func (r *TerraformReconciler) Restore(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.