aso

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsManaged

func IsManaged[T genruntime.MetaObject](ctx context.Context, ctrlClient client.Client, resource T, owner client.Object) (bool, error)

IsManaged returns whether the ASO resource referred to by spec was created by CAPZ and therefore whether CAPZ should manage its lifecycle.

func PatchedParameters added in v1.14.0

func PatchedParameters[T genruntime.MetaObject](ctx context.Context, scheme *runtime.Scheme, spec azure.ASOResourceSpecGetter[T], existing T) (T, error)

PatchedParameters returns the Parameters of spec with patches applied.

Types

type Patcher added in v1.14.0

type Patcher interface {
	ExtraPatches() []string
}

Patcher supplies extra patches to be applied to an ASO resource.

type Reconciler

type Reconciler[T genruntime.MetaObject] interface {
	CreateOrUpdateResource(ctx context.Context, spec azure.ASOResourceSpecGetter[T], serviceName string) (result T, err error)
	DeleteResource(ctx context.Context, resource T, serviceName string) (err error)
	PauseResource(ctx context.Context, resource T, serviceName string) (err error)
}

Reconciler is a generic interface used to perform reconciliation of Azure resources backed by ASO.

func New

func New[T genruntime.MetaObject](ctrlClient client.Client, clusterName string, owner client.Object) Reconciler[T]

New creates a new ASO reconciler.

type Scope added in v1.12.0

type Scope interface {
	azure.AsyncStatusUpdater
	GetClient() client.Client
	ClusterName() string
	ASOOwner() client.Object
}

Scope represents the common functionality related to all scopes needed for ASO services.

type Service

type Service[T genruntime.MetaObject, S Scope] struct {
	Reconciler[T]

	Scope S
	Specs []azure.ASOResourceSpecGetter[T]
	// ListFunc is used to enumerate ASO existent resources. Currently this interface is designed only to aid
	// discovery of ASO resources that no longer have a CAPZ reference, and can thus be deleted. This behavior
	// may be skipped for a service by leaving this field nil.
	ListFunc func(ctx context.Context, client client.Client, opts ...client.ListOption) (resources []T, err error)

	ConditionType                  clusterv1.ConditionType
	PostCreateOrUpdateResourceHook func(ctx context.Context, scope S, result T, err error) error
	PostReconcileHook              func(ctx context.Context, scope S, err error) error
	PostDeleteHook                 func(ctx context.Context, scope S, err error) error
	// contains filtered or unexported fields
}

Service provides operations on Azure resources.

func NewService added in v1.12.0

func NewService[T genruntime.MetaObject, S Scope](name string, scope S) *Service[T, S]

NewService creates a new Service.

func (*Service[T, S]) Delete added in v1.12.0

func (s *Service[T, S]) Delete(ctx context.Context) error

Delete deletes the resources.

func (*Service[T, S]) Name added in v1.12.0

func (s *Service[T, S]) Name() string

Name returns the service name.

func (*Service[T, S]) Pause added in v1.12.0

func (s *Service[T, S]) Pause(ctx context.Context) error

Pause implements azure.Pauser.

func (*Service[T, S]) Reconcile added in v1.12.0

func (s *Service[T, S]) Reconcile(ctx context.Context) error

Reconcile idempotently creates or updates the resources.

type TagsGetterSetter added in v1.11.0

type TagsGetterSetter[T genruntime.MetaObject] interface {
	GetAdditionalTags() infrav1.Tags
	GetDesiredTags(resource T) infrav1.Tags
	SetTags(resource T, tags infrav1.Tags)
}

TagsGetterSetter represents an object that supports tags.

Directories

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

Jump to

Keyboard shortcuts

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