scope

package
v0.0.0-...-44e52ee Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderPrefix = "microvm://"

Variables

This section is empty.

Functions

This section is empty.

Types

type MicrovmDeploymentScope

type MicrovmDeploymentScope struct {
	logr.Logger

	MicrovmDeployment *infrav1.MicrovmDeployment
	// contains filtered or unexported fields
}

func (*MicrovmDeploymentScope) CreatedReplicas

func (m *MicrovmDeploymentScope) CreatedReplicas() int32

CreatedReplicas returns the number of replicas which have been created.

func (*MicrovmDeploymentScope) DesiredReplicas

func (m *MicrovmDeploymentScope) DesiredReplicas() int32

DesiredReplicas returns the requested replicas set per set on the spec.

func (*MicrovmDeploymentScope) DesiredTotalReplicas

func (m *MicrovmDeploymentScope) DesiredTotalReplicas() int32

DesiredTotalReplicas returns the toal requested replicas set on the spec.

func (*MicrovmDeploymentScope) DetermineHost

func (m *MicrovmDeploymentScope) DetermineHost(setHosts infrav1.HostMap) (microvm.Host, error)

DetermineHost returns a host which does not yet have a replicaset

func (*MicrovmDeploymentScope) ExpiredHosts

func (m *MicrovmDeploymentScope) ExpiredHosts(setHosts infrav1.HostMap) infrav1.HostMap

ExpiredHosts returns hosts which have been removed from the spec

func (*MicrovmDeploymentScope) HasAllSets

func (m *MicrovmDeploymentScope) HasAllSets(count int) bool

HasAllSets returns true if all required sets have been created

func (*MicrovmDeploymentScope) Hosts

func (m *MicrovmDeploymentScope) Hosts() []microvm.Host

Hosts returns the list of hosts for created microvms

func (*MicrovmDeploymentScope) MicrovmSpec

func (m *MicrovmDeploymentScope) MicrovmSpec() infrav1.MicrovmSpec

GetMicrovmSpec returns the spec for the child MicroVM

func (*MicrovmDeploymentScope) Name

func (m *MicrovmDeploymentScope) Name() string

Name returns the MicrovmDeployment name.

func (*MicrovmDeploymentScope) Namespace

func (m *MicrovmDeploymentScope) Namespace() string

Namespace returns the namespace name.

func (*MicrovmDeploymentScope) Patch

func (m *MicrovmDeploymentScope) Patch() error

Patch persists the resource and status.

func (*MicrovmDeploymentScope) ReadyReplicas

func (m *MicrovmDeploymentScope) ReadyReplicas() int32

ReadyReplicas returns the number of replicas which are ready.

func (*MicrovmDeploymentScope) RequiredSets

func (m *MicrovmDeploymentScope) RequiredSets() int

RequiredSets returns the number of sets which should be created

func (*MicrovmDeploymentScope) SetCreatedReplicas

func (m *MicrovmDeploymentScope) SetCreatedReplicas(count int32)

SetCreatedReplicas records the number of microvms which have been created this does not give information about whether the microvms are ready

func (*MicrovmDeploymentScope) SetNotReady

func (m *MicrovmDeploymentScope) SetNotReady(
	reason string,
	severity clusterv1.ConditionSeverity,
	message string,
	messageArgs ...interface{},
)

SetNotReady sets any properties/conditions that are used to indicate that the MicrovmDeployment is NOT 'Ready'.

func (*MicrovmDeploymentScope) SetReady

func (m *MicrovmDeploymentScope) SetReady()

SetReady sets any properties/conditions that are used to indicate that the Microvm is 'Ready'.

func (*MicrovmDeploymentScope) SetReadyReplicas

func (m *MicrovmDeploymentScope) SetReadyReplicas(count int32)

SetReadyReplicas saves the number of ready MicroVMs to the status

type MicrovmDeploymentScopeParams

type MicrovmDeploymentScopeParams struct {
	Logger            logr.Logger
	MicrovmDeployment *infrav1.MicrovmDeployment

	Client  client.Client
	Context context.Context //nolint: containedctx // don't care
}

type MicrovmReplicaSetScope

type MicrovmReplicaSetScope struct {
	logr.Logger

	MicrovmReplicaSet *infrav1.MicrovmReplicaSet
	// contains filtered or unexported fields
}

func (*MicrovmReplicaSetScope) CreatedReplicas

func (m *MicrovmReplicaSetScope) CreatedReplicas() int32

CreatedReplicas returns the number of replicas which have been created.

func (*MicrovmReplicaSetScope) DesiredReplicas

func (m *MicrovmReplicaSetScope) DesiredReplicas() int32

DesiredReplicas returns requested replicas set on the spec.

func (*MicrovmReplicaSetScope) MicrovmHost

func (m *MicrovmReplicaSetScope) MicrovmHost() microvm.Host

GetMicrovmHost returns the host for the child MicroVM

func (*MicrovmReplicaSetScope) MicrovmSpec

func (m *MicrovmReplicaSetScope) MicrovmSpec() infrav1.MicrovmSpec

GetMicrovmSpec returns the spec for the child MicroVM

func (*MicrovmReplicaSetScope) Name

func (m *MicrovmReplicaSetScope) Name() string

Name returns the MicrovmReplicaSet name.

func (*MicrovmReplicaSetScope) Namespace

func (m *MicrovmReplicaSetScope) Namespace() string

Namespace returns the namespace name.

func (*MicrovmReplicaSetScope) Patch

func (m *MicrovmReplicaSetScope) Patch() error

Patch persists the resource and status.

func (*MicrovmReplicaSetScope) ReadyReplicas

func (m *MicrovmReplicaSetScope) ReadyReplicas() int32

ReadyReplicas returns the number of replicas which are ready.

func (*MicrovmReplicaSetScope) SetCreatedReplicas

func (m *MicrovmReplicaSetScope) SetCreatedReplicas(count int32)

SetCreatedReplicas records the number of microvms which have been created this does not give information about whether the microvms are ready

func (*MicrovmReplicaSetScope) SetNotReady

func (m *MicrovmReplicaSetScope) SetNotReady(
	reason string,
	severity clusterv1.ConditionSeverity,
	message string,
	messageArgs ...interface{},
)

SetNotReady sets any properties/conditions that are used to indicate that the MicrovmReplicaSet is NOT 'Ready'.

func (*MicrovmReplicaSetScope) SetReady

func (m *MicrovmReplicaSetScope) SetReady()

SetReady sets any properties/conditions that are used to indicate that the Microvm is 'Ready'.

func (*MicrovmReplicaSetScope) SetReadyReplicas

func (m *MicrovmReplicaSetScope) SetReadyReplicas(count int32)

SetReadyReplicas saves the number of ready MicroVMs to the status

type MicrovmReplicaSetScopeParams

type MicrovmReplicaSetScopeParams struct {
	Logger            logr.Logger
	MicrovmReplicaSet *infrav1.MicrovmReplicaSet

	Client  client.Client
	Context context.Context //nolint: containedctx // don't care
}

type MicrovmScope

type MicrovmScope struct {
	logr.Logger

	MicroVM *infrav1.Microvm
	// contains filtered or unexported fields
}

func NewMicrovmScope

func NewMicrovmScope(params MicrovmScopeParams) (*MicrovmScope, error)

func (*MicrovmScope) GetBasicAuthToken

func (m *MicrovmScope) GetBasicAuthToken() (string, error)

GetBasicAuthToken will fetch the BasicAuthSecret from the cluster and return the token for the given host. If no secret or no value is found, an empty string is returned.

func (*MicrovmScope) GetInstanceID

func (m *MicrovmScope) GetInstanceID() string

GetInstanceID gets the instance ID (i.e. UID) of the mvm.

func (*MicrovmScope) GetLabels

func (m *MicrovmScope) GetLabels() map[string]string

GetLabels returns any user defined or default labels for the microvm.

func (*MicrovmScope) GetMicrovmSpec

func (m *MicrovmScope) GetMicrovmSpec() microvm.VMSpec

GetMicrovmSpec returns the spec for the MicroVM

func (*MicrovmScope) GetProviderID

func (m *MicrovmScope) GetProviderID() string

GetProviderID returns the provider if for the vm. If there is no provider id then an empty string will be returned.

func (*MicrovmScope) GetRawBootstrapData

func (m *MicrovmScope) GetRawBootstrapData() (string, error)

GetRawBootstrapData will return any scripts intended to run on the microvm

func (*MicrovmScope) GetSSHPublicKeys

func (m *MicrovmScope) GetSSHPublicKeys() []microvm.SSHPublicKey

GetSSHPublicKeys will return the SSH public keys for this vm.

func (*MicrovmScope) GetTLSConfig

func (m *MicrovmScope) GetTLSConfig() (*flclient.TLSConfig, error)

GetTLSConfig will fetch the TLSSecretRef and CASecretRef for the MicroVM and return the TLS config for the client. If either are not set, it will be assumed that the host is not configured will TLS and all client calls will be made without credentials.

func (*MicrovmScope) Name

func (m *MicrovmScope) Name() string

Name returns the Microvm name.

func (*MicrovmScope) Namespace

func (m *MicrovmScope) Namespace() string

Namespace returns the namespace name.

func (*MicrovmScope) Patch

func (m *MicrovmScope) Patch() error

Patch persists the resource and status.

func (*MicrovmScope) SetNotReady

func (m *MicrovmScope) SetNotReady(
	reason string,
	severity clusterv1.ConditionSeverity,
	message string,
	messageArgs ...interface{},
)

SetNotReady sets any properties/conditions that are used to indicate that the Microvm is NOT 'Ready'.

func (*MicrovmScope) SetProviderID

func (m *MicrovmScope) SetProviderID(mvmUID string)

SetProviderID saves the unique microvm and object ID to the Mvm spec.

func (*MicrovmScope) SetReady

func (m *MicrovmScope) SetReady()

SetReady sets any properties/conditions that are used to indicate that the Microvm is 'Ready'.

type MicrovmScopeParams

type MicrovmScopeParams struct {
	Logger  logr.Logger
	MicroVM *infrav1.Microvm

	Client  client.Client
	Context context.Context //nolint: containedctx // don't care
}

Jump to

Keyboard shortcuts

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