Documentation ¶
Index ¶
- Constants
- func CreateLinodeClient(apiKey string) (*linodego.Client, error)
- type ClusterScope
- func (s *ClusterScope) AddCredentialsRefFinalizer(ctx context.Context) error
- func (s *ClusterScope) AddFinalizer(ctx context.Context) error
- func (s *ClusterScope) Close(ctx context.Context) error
- func (s *ClusterScope) PatchObject(ctx context.Context) error
- func (s *ClusterScope) RemoveCredentialsRefFinalizer(ctx context.Context) error
- type ClusterScopeParams
- type K8sClient
- type LinodeInstanceClient
- type LinodeMachineClient
- type LinodeNodeBalancerClient
- type LinodeObjectStorageClient
- type LinodeVPCClient
- type MachineScope
- func (s *MachineScope) AddCredentialsRefFinalizer(ctx context.Context) error
- func (s *MachineScope) AddFinalizer(ctx context.Context) error
- func (s *MachineScope) Close(ctx context.Context) error
- func (m *MachineScope) GetBootstrapData(ctx context.Context) ([]byte, error)
- func (s *MachineScope) PatchObject(ctx context.Context) error
- func (s *MachineScope) RemoveCredentialsRefFinalizer(ctx context.Context) error
- type MachineScopeParams
- type ObjectStorageBucketScope
- func (s *ObjectStorageBucketScope) AddFinalizer(ctx context.Context) error
- func (s *ObjectStorageBucketScope) Close(ctx context.Context) error
- func (s *ObjectStorageBucketScope) GenerateKeySecret(ctx context.Context, keys [NumAccessKeys]*linodego.ObjectStorageKey, ...) (*corev1.Secret, error)
- func (s *ObjectStorageBucketScope) PatchObject(ctx context.Context) error
- func (s *ObjectStorageBucketScope) ShouldInitKeys() bool
- func (s *ObjectStorageBucketScope) ShouldRestoreKeySecret(ctx context.Context) (bool, error)
- func (s *ObjectStorageBucketScope) ShouldRotateKeys() bool
- type ObjectStorageBucketScopeParams
- type VPCScope
- func (s *VPCScope) AddCredentialsRefFinalizer(ctx context.Context) error
- func (s *VPCScope) AddFinalizer(ctx context.Context) error
- func (s *VPCScope) Close(ctx context.Context) error
- func (s *VPCScope) PatchObject(ctx context.Context) error
- func (s *VPCScope) RemoveCredentialsRefFinalizer(ctx context.Context) error
- type VPCScopeParams
Constants ¶
const AccessKeyNameTemplate = "%s-bucket-details"
const NumAccessKeys = 2
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClusterScope ¶
type ClusterScope struct { Client K8sClient PatchHelper *patch.Helper LinodeClient LinodeNodeBalancerClient Cluster *clusterv1.Cluster LinodeCluster *infrav1alpha1.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 *infrav1alpha1.LinodeCluster }
ClusterScopeParams defines the input parameters used to create a new Scope.
type LinodeInstanceClient ¶
type LinodeInstanceClient interface { GetInstanceIPAddresses(ctx context.Context, linodeID int) (*linodego.InstanceIPAddressResponse, error) ListInstances(ctx context.Context, opts *linodego.ListOptions) ([]linodego.Instance, error) CreateInstance(ctx context.Context, opts linodego.InstanceCreateOptions) (*linodego.Instance, error) BootInstance(ctx context.Context, linodeID int, configID int) error ListInstanceConfigs(ctx context.Context, linodeID int, opts *linodego.ListOptions) ([]linodego.InstanceConfig, error) UpdateInstanceConfig(ctx context.Context, linodeID int, configID int, opts linodego.InstanceConfigUpdateOptions) (*linodego.InstanceConfig, error) GetInstanceDisk(ctx context.Context, linodeID int, diskID int) (*linodego.InstanceDisk, error) ResizeInstanceDisk(ctx context.Context, linodeID int, diskID int, size int) error CreateInstanceDisk(ctx context.Context, linodeID int, opts linodego.InstanceDiskCreateOptions) (*linodego.InstanceDisk, error) GetInstance(ctx context.Context, linodeID int) (*linodego.Instance, error) DeleteInstance(ctx context.Context, linodeID int) error GetRegion(ctx context.Context, regionID string) (*linodego.Region, error) GetImage(ctx context.Context, imageID string) (*linodego.Image, error) CreateStackscript(ctx context.Context, opts linodego.StackscriptCreateOptions) (*linodego.Stackscript, error) ListStackscripts(ctx context.Context, opts *linodego.ListOptions) ([]linodego.Stackscript, error) }
LinodeInstanceClient defines the methods that a Linode client must have to interact with Linode's Instance service.
type LinodeMachineClient ¶
type LinodeMachineClient interface { LinodeNodeBalancerClient LinodeInstanceClient LinodeVPCClient }
LinodeClient is an interface that defines the methods that a Linode client must have to interact with Linode. It defines all the functions that are required to create, delete, and get resources from Linode such as object storage buckets, node balancers, linodes, and VPCs.
type LinodeNodeBalancerClient ¶
type LinodeNodeBalancerClient interface { ListNodeBalancers(ctx context.Context, opts *linodego.ListOptions) ([]linodego.NodeBalancer, error) CreateNodeBalancer(ctx context.Context, opts linodego.NodeBalancerCreateOptions) (*linodego.NodeBalancer, error) CreateNodeBalancerConfig(ctx context.Context, nodebalancerID int, opts linodego.NodeBalancerConfigCreateOptions) (*linodego.NodeBalancerConfig, error) DeleteNodeBalancerNode(ctx context.Context, nodebalancerID int, configID int, nodeID int) error DeleteNodeBalancer(ctx context.Context, nodebalancerID int) error CreateNodeBalancerNode(ctx context.Context, nodebalancerID int, configID int, opts linodego.NodeBalancerNodeCreateOptions) (*linodego.NodeBalancerNode, error) }
LinodeNodeBalancerClient defines the methods that a Linode client must have to interact with Linode's Node Balancer service.
type LinodeObjectStorageClient ¶
type LinodeObjectStorageClient interface { GetObjectStorageBucket(ctx context.Context, cluster, label string) (*linodego.ObjectStorageBucket, error) CreateObjectStorageBucket(ctx context.Context, opts linodego.ObjectStorageBucketCreateOptions) (*linodego.ObjectStorageBucket, error) GetObjectStorageKey(ctx context.Context, keyID int) (*linodego.ObjectStorageKey, error) CreateObjectStorageKey(ctx context.Context, opts linodego.ObjectStorageKeyCreateOptions) (*linodego.ObjectStorageKey, error) DeleteObjectStorageKey(ctx context.Context, keyID int) error }
LinodeObjectStorageClient defines the methods that a Linode client must have to interact with Linode's Object Storage service.
type LinodeVPCClient ¶
type LinodeVPCClient interface { GetVPC(ctx context.Context, vpcID int) (*linodego.VPC, error) ListVPCs(ctx context.Context, opts *linodego.ListOptions) ([]linodego.VPC, error) CreateVPC(ctx context.Context, opts linodego.VPCCreateOptions) (*linodego.VPC, error) DeleteVPC(ctx context.Context, vpcID int) error }
LinodeVPCClient defines the methods that a Linode client must have to interact with Linode's VPC service.
type MachineScope ¶
type MachineScope struct { Client K8sClient PatchHelper *patch.Helper Cluster *clusterv1.Cluster Machine *clusterv1.Machine LinodeClient LinodeMachineClient LinodeCluster *infrav1alpha1.LinodeCluster LinodeMachine *infrav1alpha1.LinodeMachine }
func NewMachineScope ¶
func NewMachineScope(ctx context.Context, apiKey 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 *infrav1alpha1.LinodeCluster LinodeMachine *infrav1alpha1.LinodeMachine }
type ObjectStorageBucketScope ¶
type ObjectStorageBucketScope struct { Client K8sClient Bucket *infrav1alpha1.LinodeObjectStorageBucket Logger logr.Logger LinodeClient LinodeObjectStorageClient 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 ¶
func (s *ObjectStorageBucketScope) Close(ctx context.Context) error
Close closes the current scope persisting the object storage bucket configuration and status.
func (*ObjectStorageBucketScope) GenerateKeySecret ¶
func (s *ObjectStorageBucketScope) GenerateKeySecret(ctx context.Context, keys [NumAccessKeys]*linodego.ObjectStorageKey, bucket *linodego.ObjectStorageBucket) (*corev1.Secret, error)
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 VPCScope ¶
type VPCScope struct { Client K8sClient PatchHelper *patch.Helper LinodeClient LinodeVPCClient LinodeVPC *infrav1alpha1.LinodeVPC }
VPCScope defines the basic context for an actuator to operate upon.
func NewVPCScope ¶
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 (*VPCScope) AddFinalizer ¶
AddFinalizer adds a finalizer if not present and immediately patches the object to avoid any race conditions.
func (*VPCScope) Close ¶
Close closes the current scope persisting the machine configuration and status.
func (*VPCScope) PatchObject ¶
PatchObject persists the machine configuration and status.
type VPCScopeParams ¶
type VPCScopeParams struct { Client K8sClient LinodeVPC *infrav1alpha1.LinodeVPC }
VPCScopeParams defines the input parameters used to create a new Scope.