scope

package
v0.1.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBootstrapDataNotReady = errors.New("error retrieving bootstrap data: linked Machine's bootstrap.dataSecretName is nil")
View Source
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

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 Manifests

type Manifests interface {
	Apply(ctx context.Context, client clientcmd.ClientConfig, extVar map[string]string) error
	Hash(extVar map[string]string) (string, error)
}

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.

Directories

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

Jump to

Keyboard shortcuts

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