Documentation ¶
Index ¶
- Variables
- func IsControlPlaneReady(ctx context.Context, c clientcmd.ClientConfig) error
- type ClusterScope
- func (s *ClusterScope) ApplyManifestsWithClientConfig(ctx context.Context, c clientcmd.ClientConfig) error
- func (s *ClusterScope) ClientConfig() (clientcmd.ClientConfig, error)
- func (s *ClusterScope) ClientConfigWithAPIEndpoint(endpoint clusterv1.APIEndpoint) (clientcmd.ClientConfig, error)
- func (s *ClusterScope) Close() error
- func (s *ClusterScope) ControlPlaneAPIEndpointPort() int32
- func (s *ClusterScope) EnsureCiliumIPSecKeysExists(ctx context.Context) (keys *string, err error)
- func (s *ClusterScope) GetSpecLocations() []infrav1.HcloudLocation
- func (s *ClusterScope) HcloudClient() HcloudClient
- func (s *ClusterScope) IsUsingCilium() bool
- func (s *ClusterScope) ListMachines(ctx context.Context) ([]*clusterv1.Machine, []*infrav1.HcloudMachine, error)
- func (s *ClusterScope) ManifestsHash() (string, error)
- func (m *ClusterScope) Name() string
- func (m *ClusterScope) Namespace() string
- func (s *ClusterScope) SetStatusLocations(locations []infrav1.HcloudLocation, networkZone infrav1.HcloudNetworkZone)
- type ClusterScopeParams
- type HcloudClient
- type HcloudClientFactory
- type MachineScope
- func (s *MachineScope) Close() error
- func (s *MachineScope) EnsureImage(ctx context.Context, parameters *packerapi.PackerParameters) (*infrav1.HcloudImageID, error)
- func (m *MachineScope) GetFailureDomain() (string, error)
- func (m *MachineScope) GetRawBootstrapData(ctx context.Context) ([]byte, error)
- func (m *MachineScope) IsControlPlane() bool
- func (m *MachineScope) Name() string
- func (m *MachineScope) Namespace() string
- func (m *MachineScope) PatchObject(ctx context.Context) error
- type MachineScopeParams
- type Manifests
- type Packer
- type VolumeScope
- type VolumeScopeParams
Constants ¶
This section is empty.
Variables ¶
var ErrBootstrapDataNotReady = errors.New("error retrieving bootstrap data: linked Machine's bootstrap.dataSecretName is nil")
var ErrFailureDomainNotFound = errors.New("error no failure domain available")
Functions ¶
func IsControlPlaneReady ¶
func IsControlPlaneReady(ctx context.Context, c clientcmd.ClientConfig) error
Types ¶
type ClusterScope ¶
type ClusterScope struct { Ctx context.Context logr.Logger Client client.Client Cluster *clusterv1.Cluster HcloudCluster *infrav1.HcloudCluster // contains filtered or unexported fields }
ClusterScope defines the basic context for an actuator to operate upon.
func NewClusterScope ¶
func NewClusterScope(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) ApplyManifestsWithClientConfig ¶
func (s *ClusterScope) ApplyManifestsWithClientConfig(ctx context.Context, c clientcmd.ClientConfig) error
func (*ClusterScope) ClientConfig ¶
func (s *ClusterScope) ClientConfig() (clientcmd.ClientConfig, error)
ClientConfig return a kubernetes client config for the cluster context
func (*ClusterScope) ClientConfigWithAPIEndpoint ¶
func (s *ClusterScope) ClientConfigWithAPIEndpoint(endpoint clusterv1.APIEndpoint) (clientcmd.ClientConfig, error)
func (*ClusterScope) Close ¶
func (s *ClusterScope) Close() error
Close closes the current scope persisting the cluster configuration and status.
func (*ClusterScope) ControlPlaneAPIEndpointPort ¶
func (s *ClusterScope) ControlPlaneAPIEndpointPort() int32
func (*ClusterScope) EnsureCiliumIPSecKeysExists ¶
func (s *ClusterScope) EnsureCiliumIPSecKeysExists(ctx context.Context) (keys *string, err error)
func (*ClusterScope) GetSpecLocations ¶
func (s *ClusterScope) GetSpecLocations() []infrav1.HcloudLocation
func (*ClusterScope) HcloudClient ¶
func (s *ClusterScope) HcloudClient() HcloudClient
func (*ClusterScope) IsUsingCilium ¶
func (s *ClusterScope) IsUsingCilium() bool
func (*ClusterScope) ListMachines ¶
func (s *ClusterScope) ListMachines(ctx context.Context) ([]*clusterv1.Machine, []*infrav1.HcloudMachine, error)
func (*ClusterScope) ManifestsHash ¶
func (s *ClusterScope) ManifestsHash() (string, error)
func (*ClusterScope) Name ¶
func (m *ClusterScope) Name() string
Name returns the HcloudCluster name.
func (*ClusterScope) Namespace ¶
func (m *ClusterScope) Namespace() string
Namespace returns the namespace name.
func (*ClusterScope) SetStatusLocations ¶
func (s *ClusterScope) SetStatusLocations(locations []infrav1.HcloudLocation, networkZone infrav1.HcloudNetworkZone)
type ClusterScopeParams ¶
type ClusterScopeParams struct { HcloudClient Ctx context.Context HcloudClientFactory HcloudClientFactory Client client.Client Logger logr.Logger Cluster *clusterv1.Cluster HcloudCluster *infrav1.HcloudCluster Packer Packer Manifests Manifests }
ClusterScopeParams defines the input parameters used to create a new Scope.
type HcloudClient ¶
type HcloudClient interface { Token() string ListLocation(context.Context) ([]*hcloud.Location, error) CreateFloatingIP(context.Context, hcloud.FloatingIPCreateOpts) (hcloud.FloatingIPCreateResult, *hcloud.Response, error) DeleteFloatingIP(context.Context, *hcloud.FloatingIP) (*hcloud.Response, error) ListFloatingIPs(context.Context, hcloud.FloatingIPListOpts) ([]*hcloud.FloatingIP, error) ListImages(context.Context, hcloud.ImageListOpts) ([]*hcloud.Image, error) CreateServer(context.Context, hcloud.ServerCreateOpts) (hcloud.ServerCreateResult, *hcloud.Response, error) ListServers(context.Context, hcloud.ServerListOpts) ([]*hcloud.Server, error) DeleteServer(context.Context, *hcloud.Server) (*hcloud.Response, error) ShutdownServer(context.Context, *hcloud.Server) (*hcloud.Action, *hcloud.Response, error) CreateVolume(context.Context, hcloud.VolumeCreateOpts) (hcloud.VolumeCreateResult, *hcloud.Response, error) ListVolumes(context.Context, hcloud.VolumeListOpts) ([]*hcloud.Volume, error) DeleteVolume(context.Context, *hcloud.Volume) (*hcloud.Response, error) CreateNetwork(context.Context, hcloud.NetworkCreateOpts) (*hcloud.Network, *hcloud.Response, error) ListNetworks(context.Context, hcloud.NetworkListOpts) ([]*hcloud.Network, error) DeleteNetwork(context.Context, *hcloud.Network) (*hcloud.Response, error) ListSSHKeys(ctx context.Context, opts hcloud.SSHKeyListOpts) ([]*hcloud.SSHKey, *hcloud.Response, error) }
HcloudClient collects all methods used by the controller in the hcloud cloud API
type HcloudClientFactory ¶
type HcloudClientFactory func(context.Context) (HcloudClient, error)
type MachineScope ¶
type MachineScope struct { ClusterScope Machine *clusterv1.Machine HcloudMachine *infrav1.HcloudMachine }
MachineScope defines the basic context for an actuator to operate upon.
func NewMachineScope ¶
func NewMachineScope(params MachineScopeParams) (*MachineScope, error)
NewClusterScope creates a new Scope from the supplied parameters. This is meant to be called for each reconcile iteration.
func (*MachineScope) Close ¶
func (s *MachineScope) Close() error
Close closes the current scope persisting the cluster configuration and status.
func (*MachineScope) EnsureImage ¶
func (s *MachineScope) EnsureImage(ctx context.Context, parameters *packerapi.PackerParameters) (*infrav1.HcloudImageID, error)
func (*MachineScope) GetFailureDomain ¶
func (m *MachineScope) GetFailureDomain() (string, error)
func (*MachineScope) GetRawBootstrapData ¶
func (m *MachineScope) GetRawBootstrapData(ctx context.Context) ([]byte, error)
GetRawBootstrapData returns the bootstrap data from the secret in the Machine's bootstrap.dataSecretName.
func (*MachineScope) IsControlPlane ¶
func (m *MachineScope) IsControlPlane() bool
IsControlPlane returns true if the machine is a control plane.
func (*MachineScope) Name ¶
func (m *MachineScope) Name() string
Name returns the HcloudMachine name.
func (*MachineScope) Namespace ¶
func (m *MachineScope) Namespace() string
Namespace returns the namespace name.
func (*MachineScope) PatchObject ¶
func (m *MachineScope) PatchObject(ctx context.Context) error
PatchObject persists the machine spec and status.
type MachineScopeParams ¶
type MachineScopeParams struct { ClusterScopeParams Machine *clusterv1.Machine HcloudMachine *infrav1.HcloudMachine }
ClusterScopeParams defines the input parameters used to create a new Scope.
type Packer ¶
type Packer interface {
EnsureImage(ctx context.Context, log logr.Logger, hc packerapi.HcloudClient, parameters *packerapi.PackerParameters) (*infrav1.HcloudImageID, error)
}
type VolumeScope ¶
type VolumeScope struct { ClusterScope HcloudVolume *infrav1.HcloudVolume }
ClusterScope defines the basic context for an actuator to operate upon.
func NewVolumeScope ¶
func NewVolumeScope(params VolumeScopeParams) (*VolumeScope, error)
NewClusterScope creates a new Scope from the supplied parameters. This is meant to be called for each reconcile iteration.
func (*VolumeScope) Close ¶
func (s *VolumeScope) Close() error
Close closes the current scope persisting the cluster configuration and status.
func (*VolumeScope) GetSpecLocations ¶
func (s *VolumeScope) GetSpecLocations() []infrav1.HcloudLocation
func (*VolumeScope) SetStatusLocations ¶
func (s *VolumeScope) SetStatusLocations(location []infrav1.HcloudLocation, networkZone infrav1.HcloudNetworkZone)
type VolumeScopeParams ¶
type VolumeScopeParams struct { ClusterScopeParams HcloudVolume *infrav1.HcloudVolume }
ClusterScopeParams defines the input parameters used to create a new Scope.