scope

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The maximum number of Replicas that can be created above the desired amount.
	MaxSurge = 1
)

Variables

Functions

func GetNamespaceOrDefault

func GetNamespaceOrDefault(namespace string) string

GetNamespaceOrDefault returns the default namespace if given empty

Types

type AzureStackHCIClients

type AzureStackHCIClients struct {
	CloudAgentFqdn string
	Authorizer     auth.Authorizer
}

AzureStackHCIClients contains all the AzureStackHCI clients used by the scopes.

type ClusterScope

type ClusterScope struct {
	logr.Logger
	Client client.Client

	AzureStackHCIClients
	Cluster              *clusterv1.Cluster
	AzureStackHCICluster *infrav1.AzureStackHCICluster
	Context              context.Context
	// 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) APIServerPort

func (s *ClusterScope) APIServerPort() int32

APIServerPort returns the APIServerPort to use when creating the load balancer.

func (*ClusterScope) APIVersion

func (s *ClusterScope) APIVersion() string

func (*ClusterScope) AzureStackHCILoadBalancer

func (s *ClusterScope) AzureStackHCILoadBalancer() *infrav1.AzureStackHCILoadBalancerSpec

func (*ClusterScope) Close

func (s *ClusterScope) Close() error

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

func (*ClusterScope) GetAuthorizer

func (s *ClusterScope) GetAuthorizer() auth.Authorizer

GetAuthorizer is a getter for the environment generated authorizer.

func (*ClusterScope) GetCloudAgentFqdn

func (s *ClusterScope) GetCloudAgentFqdn() string

GetCloudAgentFqdn returns the cloud agent fqdn string.

func (*ClusterScope) GetCustomResourceTypeWithName added in v1.1.9

func (s *ClusterScope) GetCustomResourceTypeWithName() string

GetCustomResourceTypeWithName return cluster resource string.

func (*ClusterScope) GetResourceGroup

func (s *ClusterScope) GetResourceGroup() string

GetResourceGroup allows ClusterScope to fulfill ScopeInterface and thus to be used by the cloud services.

func (*ClusterScope) GetSecret

func (s *ClusterScope) GetSecret(name string) (*corev1.Secret, error)

func (*ClusterScope) Kind

func (s *ClusterScope) Kind() string

func (*ClusterScope) ListOptionsLabelSelector

func (s *ClusterScope) ListOptionsLabelSelector() client.ListOption

ListOptionsLabelSelector returns a ListOptions with a label selector for clusterName.

func (*ClusterScope) Location

func (s *ClusterScope) Location() string

Location returns the cluster location.

func (*ClusterScope) Name

func (s *ClusterScope) Name() string

Name returns the cluster name.

func (*ClusterScope) Namespace

func (s *ClusterScope) Namespace() string

Namespace returns the cluster namespace.

func (*ClusterScope) PatchObject

func (s *ClusterScope) PatchObject() error

PatchObject persists the cluster configuration and status.

func (*ClusterScope) Subnets

func (s *ClusterScope) Subnets() infrav1.Subnets

Subnets returns the cluster subnets.

func (*ClusterScope) UID

func (s *ClusterScope) UID() types.UID

func (*ClusterScope) Vnet

func (s *ClusterScope) Vnet() *infrav1.VnetSpec

Vnet returns the cluster Vnet.

type ClusterScopeGetter

type ClusterScopeGetter interface {
	ClusterScope(params ClusterScopeParams) (*ClusterScope, error)
}

type ClusterScopeGetterFunc

type ClusterScopeGetterFunc func(params ClusterScopeParams) (*ClusterScope, error)

func (ClusterScopeGetterFunc) ClusterScope

func (f ClusterScopeGetterFunc) ClusterScope(params ClusterScopeParams) (*ClusterScope, error)

type ClusterScopeParams

type ClusterScopeParams struct {
	AzureStackHCIClients
	Client               client.Client
	Logger               *logr.Logger
	Cluster              *clusterv1.Cluster
	AzureStackHCICluster *infrav1.AzureStackHCICluster
	Context              context.Context
}

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

type LoadBalancerScope

type LoadBalancerScope struct {
	logr.Logger

	Context context.Context

	AzureStackHCILoadBalancer *infrav1.AzureStackHCILoadBalancer
	Cluster                   *clusterv1.Cluster
	AzureStackHCICluster      *infrav1.AzureStackHCICluster
	// contains filtered or unexported fields
}

LoadBalancerScope defines a scope defined around a LoadBalancer.

func NewLoadBalancerScope

func NewLoadBalancerScope(params LoadBalancerScopeParams) (*LoadBalancerScope, error)

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

func (*LoadBalancerScope) AddReplica added in v0.3.7

func (l *LoadBalancerScope) AddReplica()

AddReplica increments the AzureStackHCILoadBalancer Replica status

func (*LoadBalancerScope) Address

func (l *LoadBalancerScope) Address() string

Address returns the address of the AzureStackHCILoadBalancer, if it exists.

func (*LoadBalancerScope) Close

func (l *LoadBalancerScope) Close() error

Close the LoadBalancerScope by updating the AzureStackHCILoadBalancer spec and status.

func (*LoadBalancerScope) GetDesiredReplicas added in v0.3.7

func (l *LoadBalancerScope) GetDesiredReplicas() int32

GetDesiredReplicas returns the AzureStackHCILoadBalancer spec.Replicas

func (*LoadBalancerScope) GetFailedReplicas added in v0.3.7

func (l *LoadBalancerScope) GetFailedReplicas() int32

GetFailedReplicas returns the AzureStackHCILoadBalancer FailedReplica status

func (*LoadBalancerScope) GetMaxReplicas added in v0.3.7

func (l *LoadBalancerScope) GetMaxReplicas() int32

GetMaxReplicas returns the maximum number of Replicas that can be created

func (*LoadBalancerScope) GetPort

func (l *LoadBalancerScope) GetPort() int32

GetPort returns the Port field of the AzureStackHCILoadBalancer Status.

func (*LoadBalancerScope) GetReady added in v0.3.7

func (l *LoadBalancerScope) GetReady() bool

GetReady returns the AzureStackHCILoadBalancer Ready Status

func (*LoadBalancerScope) GetReadyReplicas added in v0.3.7

func (l *LoadBalancerScope) GetReadyReplicas() int32

GetReadyReplicas returns the AzureStackHCILoadBalancer ReadyReplica status

func (*LoadBalancerScope) GetReplicas added in v0.3.7

func (l *LoadBalancerScope) GetReplicas() int32

GetReplicas returns the AzureStackHCILoadBalancer Replica status

func (*LoadBalancerScope) Name

func (l *LoadBalancerScope) Name() string

Name returns the Name of the AzureStackHCILoadBalancer

func (*LoadBalancerScope) OSVersion added in v0.3.7

func (l *LoadBalancerScope) OSVersion() string

OSVersion returns the AzureStackHCILoadBalancer image OS version

func (*LoadBalancerScope) PatchObject

func (l *LoadBalancerScope) PatchObject() error

PatchObject persists the AzureStackHCILoadBalancer spec and status.

func (*LoadBalancerScope) RemoveReplica added in v0.3.7

func (l *LoadBalancerScope) RemoveReplica()

RemoveReplica decrements the AzureStackHCILoadBalancer Replica status

func (*LoadBalancerScope) SetAddress

func (l *LoadBalancerScope) SetAddress(address string)

SetAddress sets the Address field of the AzureStackHCILoadBalancer Status.

func (*LoadBalancerScope) SetAnnotation

func (l *LoadBalancerScope) SetAnnotation(key, value string)

SetAnnotation sets a key value annotation on the AzureStackHCILoadBalancer

func (*LoadBalancerScope) SetErrorMessage

func (l *LoadBalancerScope) SetErrorMessage(v error)

SetErrorMessage sets the AzureStackHCILoadBalancer status error message.

func (*LoadBalancerScope) SetErrorReason

func (l *LoadBalancerScope) SetErrorReason(v capierrors.MachineStatusError)

SetErrorReason sets the AzureStackHCILoadBalancer status error reason.

func (*LoadBalancerScope) SetFailedReplicas added in v0.3.7

func (l *LoadBalancerScope) SetFailedReplicas(replicas int32)

SetFailedReplicas sets the AzureStackHCILoadBalancer FailedReplica status

func (*LoadBalancerScope) SetPhase added in v0.3.7

SetPhase sets the Phase field of the AzureStackHCILoadBalancer Status.

func (*LoadBalancerScope) SetPort

func (l *LoadBalancerScope) SetPort(port int32)

SetPort sets the Port field of the AzureStackHCILoadBalancer Status.

func (*LoadBalancerScope) SetReady

func (l *LoadBalancerScope) SetReady()

SetReady sets the AzureStackHCILoadBalancer Ready Status

func (*LoadBalancerScope) SetReadyReplicas added in v0.3.7

func (l *LoadBalancerScope) SetReadyReplicas(replicas int32)

SetReadyReplicas sets the AzureStackHCILoadBalancer ReadyReplica status

func (*LoadBalancerScope) SetReplicas added in v0.3.7

func (l *LoadBalancerScope) SetReplicas(replicas int32)

SetReplicas sets the AzureStackHCILoadBalancer Replica status

func (*LoadBalancerScope) SetSelector added in v0.3.7

func (l *LoadBalancerScope) SetSelector(selector string)

SetSelector sets the Selector field of the AzureStackHCILoadBalancer Status.

type LoadBalancerScopeParams

type LoadBalancerScopeParams struct {
	Client                    client.Client
	Logger                    *logr.Logger
	AzureStackHCILoadBalancer *infrav1.AzureStackHCILoadBalancer
	Cluster                   *clusterv1.Cluster
	AzureStackHCICluster      *infrav1.AzureStackHCICluster
}

LoadBalancerScopeParams defines the input parameters used to create a new LoadBalancerScope.

type MachineScope

type MachineScope struct {
	logr.Logger

	Cluster              *clusterv1.Cluster
	Machine              *clusterv1.Machine
	AzureStackHCICluster *infrav1.AzureStackHCICluster
	AzureStackHCIMachine *infrav1.AzureStackHCIMachine
	// contains filtered or unexported fields
}

MachineScope defines a scope defined around a machine and its cluster.

func NewMachineScope

func NewMachineScope(params MachineScopeParams) (*MachineScope, error)

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

func (*MachineScope) AvailabilityZone

func (m *MachineScope) AvailabilityZone() string

AvailabilityZone returns the AzureStackHCIMachine Availability Zone.

func (*MachineScope) Close

func (m *MachineScope) Close() error

Close the MachineScope by updating the machine spec, machine status.

func (*MachineScope) GetBootstrapData

func (m *MachineScope) GetBootstrapData() (string, error)

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

func (*MachineScope) GetProviderID

func (m *MachineScope) GetProviderID() string

GetProviderID returns the AzureStackHCIMachine providerID from the spec.

func (*MachineScope) GetVMID

func (m *MachineScope) GetVMID() *string

GetVMID returns the AzureStackHCIMachine instance id by parsing Spec.ProviderID.

func (*MachineScope) GetVMState

func (m *MachineScope) GetVMState() *infrav1.VMState

GetVMState returns the AzureStackHCIMachine VM state.

func (*MachineScope) IsControlPlane

func (m *MachineScope) IsControlPlane() bool

IsControlPlane returns true if the machine is a control plane.

func (*MachineScope) Location

func (m *MachineScope) Location() string

Location returns the AzureStackHCIMachine location.

func (*MachineScope) Name

func (m *MachineScope) Name() string

Name returns the AzureStackHCIMachine name.

func (*MachineScope) Namespace

func (m *MachineScope) Namespace() string

Namespace returns the namespace name.

func (*MachineScope) PatchObject

func (m *MachineScope) PatchObject() error

PatchObject persists the machine spec and status.

func (*MachineScope) Role

func (m *MachineScope) Role() string

Role returns the machine role from the labels.

func (*MachineScope) SetAnnotation

func (m *MachineScope) SetAnnotation(key, value string)

SetAnnotation sets a key value annotation on the AzureStackHCIMachine.

func (*MachineScope) SetFailureMessage

func (m *MachineScope) SetFailureMessage(v error)

SetFailureMessage sets the AzureStackHCIMachine status failure message.

func (*MachineScope) SetFailureReason

func (m *MachineScope) SetFailureReason(v capierrors.MachineStatusError)

SetFailureReason sets the AzureStackHCIMachine status failure reason.

func (*MachineScope) SetProviderID

func (m *MachineScope) SetProviderID(v string)

SetProviderID sets the AzureStackHCIMachine providerID in spec.

func (*MachineScope) SetReady

func (m *MachineScope) SetReady()

SetReady sets the AzureStackHCIMachine Ready Status

func (*MachineScope) SetVMState

func (m *MachineScope) SetVMState(v *infrav1.VMState)

SetVMState sets the AzureStackHCIMachine VM state.

type MachineScopeGetter

type MachineScopeGetter interface {
	MachineScope(params MachineScopeParams) (*MachineScope, error)
}

type MachineScopeGetterFunc

type MachineScopeGetterFunc func(params MachineScopeParams) (*MachineScope, error)

func (MachineScopeGetterFunc) MachineScope

func (f MachineScopeGetterFunc) MachineScope(params MachineScopeParams) (*MachineScope, error)

type MachineScopeParams

type MachineScopeParams struct {
	AzureStackHCIClients
	Client               client.Client
	Logger               *logr.Logger
	Cluster              *clusterv1.Cluster
	Machine              *clusterv1.Machine
	AzureStackHCICluster *infrav1.AzureStackHCICluster
	AzureStackHCIMachine *infrav1.AzureStackHCIMachine
}

MachineScopeParams defines the input parameters used to create a new MachineScope.

type ScopeInterface

type ScopeInterface interface {
	GetResourceGroup() string
	GetCloudAgentFqdn() string
	GetAuthorizer() auth.Authorizer
	GetCustomResourceTypeWithName() string
}

ScopeInterface allows multiple scope types to be used for cloud services

type VirtualMachineScope

type VirtualMachineScope struct {
	logr.Logger

	Context context.Context

	AzureStackHCIClients
	AzureStackHCIVirtualMachine *infrav1.AzureStackHCIVirtualMachine
	// contains filtered or unexported fields
}

VirtualMachineScope defines a scope defined around a machine.

func NewVirtualMachineScope

func NewVirtualMachineScope(params VirtualMachineScopeParams) (*VirtualMachineScope, error)

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

func (*VirtualMachineScope) AvailabilityZone

func (m *VirtualMachineScope) AvailabilityZone() string

AvailabilityZone returns the AzureStackHCIVirtualMachine Availability Zone.

func (*VirtualMachineScope) AzureStackHCILoadBalancerVM

func (m *VirtualMachineScope) AzureStackHCILoadBalancerVM() bool

AzureStackHCILoadBalancerVM returns true if the AzureStackHCIVirtualMachine is owned by a LoadBalancer resource and false otherwise (Tenant).

func (*VirtualMachineScope) BackendPoolNames

func (m *VirtualMachineScope) BackendPoolNames() []string

BackendPoolNames returns the backend pool name for the virtual machine

func (*VirtualMachineScope) Close

func (m *VirtualMachineScope) Close() error

Close the VirtualMachineScope by updating the machine spec, machine status.

func (*VirtualMachineScope) ClusterName

func (m *VirtualMachineScope) ClusterName() string

ClusterName returns the cluster name in the vm spec.

func (*VirtualMachineScope) GetAuthorizer

func (m *VirtualMachineScope) GetAuthorizer() auth.Authorizer

GetAuthorizer is a getter for the environment generated authorizer.

func (*VirtualMachineScope) GetCloudAgentFqdn

func (m *VirtualMachineScope) GetCloudAgentFqdn() string

GetCloudAgentFqdn returns the cloud agent fqdn string.

func (*VirtualMachineScope) GetCustomResourceTypeWithName added in v1.1.9

func (m *VirtualMachineScope) GetCustomResourceTypeWithName() string

GetCustomResourceTypeWithName return cluster resource string.

func (*VirtualMachineScope) GetResourceGroup

func (m *VirtualMachineScope) GetResourceGroup() string

GetResourceGroup allows VirtualMachineScope to fulfill ScopeInterface and thus to be used by the cloud services.

func (*VirtualMachineScope) GetVMState

func (m *VirtualMachineScope) GetVMState() *infrav1.VMState

GetVMState returns the AzureStackHCIVirtualMachine VM state.

func (*VirtualMachineScope) Location

func (m *VirtualMachineScope) Location() string

Location returns the AzureStackHCIVirtualMachine location.

func (*VirtualMachineScope) Name

func (m *VirtualMachineScope) Name() string

Name returns the AzureStackHCIVirtualMachine name.

func (*VirtualMachineScope) Namespace

func (m *VirtualMachineScope) Namespace() string

Namespace returns the namespace name.

func (*VirtualMachineScope) PatchObject

func (m *VirtualMachineScope) PatchObject() error

PatchObject persists the virtual machine spec and status.

func (*VirtualMachineScope) SetAnnotation

func (m *VirtualMachineScope) SetAnnotation(key, value string)

SetAnnotation sets a key value annotation on the AzureStackHCIVirtualMachine.

func (*VirtualMachineScope) SetFailureMessage

func (m *VirtualMachineScope) SetFailureMessage(v error)

SetFailureMessage sets the AzureStackHCIVirtualMachine status failure message.

func (*VirtualMachineScope) SetFailureReason

func (m *VirtualMachineScope) SetFailureReason(v capierrors.MachineStatusError)

SetFailureReason sets the AzureStackHCIVirtualMachine status failure reason.

func (*VirtualMachineScope) SetReady

func (m *VirtualMachineScope) SetReady()

SetReady sets the AzureStackHCIVirtualMachine Ready Status

func (*VirtualMachineScope) SetVMState

func (m *VirtualMachineScope) SetVMState(v infrav1.VMState)

SetVMState sets the AzureStackHCIVirtualMachine VM state.

func (*VirtualMachineScope) SubnetName

func (m *VirtualMachineScope) SubnetName() string

SubnetName returns the subnet name given in the vm spec.

func (*VirtualMachineScope) VnetName

func (m *VirtualMachineScope) VnetName() string

VnetName returns the vnet name given in the vm spec.

type VirtualMachineScopeParams

type VirtualMachineScopeParams struct {
	AzureStackHCIClients
	Client                      client.Client
	Logger                      *logr.Logger
	AzureStackHCIVirtualMachine *infrav1.AzureStackHCIVirtualMachine
}

MachineScopeParams defines the input parameters used to create a new VirtualMachineScope.

Jump to

Keyboard shortcuts

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