scope

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessKeyNameTemplate = "%s-bucket-details"
	NumAccessKeys         = 2
)

Variables

This section is empty.

Functions

func CreateLinodeClient

func CreateLinodeClient(apiKey string, timeout time.Duration, opts ...Option) (LinodeClient, error)

Types

type ClusterScope

type ClusterScope struct {
	Client        K8sClient
	PatchHelper   *patch.Helper
	LinodeClient  LinodeClient
	Cluster       *clusterv1.Cluster
	LinodeCluster *infrav1alpha2.LinodeCluster
}

ClusterScope defines the basic context for an actuator to operate upon.

func NewClusterScope

func NewClusterScope(ctx context.Context, apiKey string, params ClusterScopeParams) (*ClusterScope, error)

NewClusterScope creates a new Scope from the supplied parameters. This is meant to be called for each reconcile iteration.

func (*ClusterScope) AddCredentialsRefFinalizer added in v0.2.0

func (s *ClusterScope) AddCredentialsRefFinalizer(ctx context.Context) error

func (*ClusterScope) AddFinalizer

func (s *ClusterScope) AddFinalizer(ctx context.Context) error

AddFinalizer adds a finalizer if not present and immediately patches the object to avoid any race conditions.

func (*ClusterScope) Close

func (s *ClusterScope) Close(ctx context.Context) error

Close closes the current scope persisting the cluster configuration and status.

func (*ClusterScope) PatchObject

func (s *ClusterScope) PatchObject(ctx context.Context) error

PatchObject persists the cluster configuration and status.

func (*ClusterScope) RemoveCredentialsRefFinalizer added in v0.2.0

func (s *ClusterScope) RemoveCredentialsRefFinalizer(ctx context.Context) error

type ClusterScopeParams

type ClusterScopeParams struct {
	Client        K8sClient
	Cluster       *clusterv1.Cluster
	LinodeCluster *infrav1alpha2.LinodeCluster
}

ClusterScopeParams defines the input parameters used to create a new Scope.

type MachineScope

type MachineScope struct {
	Client              K8sClient
	PatchHelper         *patch.Helper
	Cluster             *clusterv1.Cluster
	Machine             *clusterv1.Machine
	LinodeClient        LinodeClient
	LinodeDomainsClient LinodeClient
	LinodeCluster       *infrav1alpha2.LinodeCluster
	LinodeMachine       *infrav1alpha1.LinodeMachine
}

func NewMachineScope

func NewMachineScope(ctx context.Context, apiKey, dnsKey string, params MachineScopeParams) (*MachineScope, error)

func (*MachineScope) AddCredentialsRefFinalizer added in v0.2.0

func (s *MachineScope) AddCredentialsRefFinalizer(ctx context.Context) error

func (*MachineScope) AddFinalizer

func (s *MachineScope) AddFinalizer(ctx context.Context) error

AddFinalizer adds a finalizer if not present and immediately patches the object to avoid any race conditions.

func (*MachineScope) Close

func (s *MachineScope) Close(ctx context.Context) error

Close closes the current scope persisting the machine configuration and status.

func (*MachineScope) GetBootstrapData

func (m *MachineScope) GetBootstrapData(ctx context.Context) ([]byte, error)

GetBootstrapData returns the bootstrap data from the secret in the Machine's bootstrap.dataSecretName.

func (*MachineScope) PatchObject

func (s *MachineScope) PatchObject(ctx context.Context) error

PatchObject persists the machine configuration and status.

func (*MachineScope) RemoveCredentialsRefFinalizer added in v0.2.0

func (s *MachineScope) RemoveCredentialsRefFinalizer(ctx context.Context) error

type MachineScopeParams

type MachineScopeParams struct {
	Client        K8sClient
	Cluster       *clusterv1.Cluster
	Machine       *clusterv1.Machine
	LinodeCluster *infrav1alpha2.LinodeCluster
	LinodeMachine *infrav1alpha1.LinodeMachine
}

type ObjectStorageBucketScope

type ObjectStorageBucketScope struct {
	Client       K8sClient
	Bucket       *infrav1alpha1.LinodeObjectStorageBucket
	Logger       logr.Logger
	LinodeClient LinodeClient
	PatchHelper  *patch.Helper
}

func NewObjectStorageBucketScope

func NewObjectStorageBucketScope(ctx context.Context, apiKey string, params ObjectStorageBucketScopeParams) (*ObjectStorageBucketScope, error)

func (*ObjectStorageBucketScope) AddFinalizer

func (s *ObjectStorageBucketScope) AddFinalizer(ctx context.Context) error

AddFinalizer adds a finalizer if not present and immediately patches the object to avoid any race conditions.

func (*ObjectStorageBucketScope) Close

Close closes the current scope persisting the object storage bucket configuration and status.

func (*ObjectStorageBucketScope) GenerateKeySecret

GenerateKeySecret returns a secret suitable for submission to the Kubernetes API. The secret is expected to contain keys for accessing the bucket, as well as owner and controller references.

func (*ObjectStorageBucketScope) PatchObject

func (s *ObjectStorageBucketScope) PatchObject(ctx context.Context) error

PatchObject persists the object storage bucket configuration and status.

func (*ObjectStorageBucketScope) ShouldInitKeys

func (s *ObjectStorageBucketScope) ShouldInitKeys() bool

func (*ObjectStorageBucketScope) ShouldRestoreKeySecret

func (s *ObjectStorageBucketScope) ShouldRestoreKeySecret(ctx context.Context) (bool, error)

func (*ObjectStorageBucketScope) ShouldRotateKeys

func (s *ObjectStorageBucketScope) ShouldRotateKeys() bool

type ObjectStorageBucketScopeParams

type ObjectStorageBucketScopeParams struct {
	Client K8sClient
	Bucket *infrav1alpha1.LinodeObjectStorageBucket
	Logger *logr.Logger
}

type Option added in v0.4.0

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

func WithRetryCount added in v0.4.0

func WithRetryCount(c int) Option

type VPCScope

type VPCScope struct {
	Client K8sClient

	PatchHelper  *patch.Helper
	LinodeClient LinodeClient
	LinodeVPC    *infrav1alpha1.LinodeVPC
}

VPCScope defines the basic context for an actuator to operate upon.

func NewVPCScope

func NewVPCScope(ctx context.Context, apiKey string, params VPCScopeParams) (*VPCScope, error)

NewVPCScope creates a new Scope from the supplied parameters. This is meant to be called for each reconcile iteration.

func (*VPCScope) AddCredentialsRefFinalizer added in v0.2.0

func (s *VPCScope) AddCredentialsRefFinalizer(ctx context.Context) error

func (*VPCScope) AddFinalizer

func (s *VPCScope) AddFinalizer(ctx context.Context) error

AddFinalizer adds a finalizer if not present and immediately patches the object to avoid any race conditions.

func (*VPCScope) Close

func (s *VPCScope) Close(ctx context.Context) error

Close closes the current scope persisting the machine configuration and status.

func (*VPCScope) PatchObject

func (s *VPCScope) PatchObject(ctx context.Context) error

PatchObject persists the machine configuration and status.

func (*VPCScope) RemoveCredentialsRefFinalizer added in v0.2.0

func (s *VPCScope) RemoveCredentialsRefFinalizer(ctx context.Context) error

type VPCScopeParams

type VPCScopeParams struct {
	Client    K8sClient
	LinodeVPC *infrav1alpha1.LinodeVPC
}

VPCScopeParams defines the input parameters used to create a new Scope.

Jump to

Keyboard shortcuts

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