scope

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureClients

type AzureClients struct {
	Authorizer autorest.Authorizer
	auth.EnvironmentSettings
	ResourceManagerEndpoint    string
	ResourceManagerVMDNSSuffix string
}

AzureClients contains all the Azure clients used by the scopes.

func (*AzureClients) ClientID added in v0.4.7

func (c *AzureClients) ClientID() string

ClientID returns the Azure client id from the controller environment

func (*AzureClients) ClientSecret added in v0.4.7

func (c *AzureClients) ClientSecret() string

ClientSecret returns the Azure client secret from the controller environment

func (*AzureClients) CloudEnvironment added in v0.4.7

func (c *AzureClients) CloudEnvironment() string

CloudEnvironment returns the Azure environment the controller runs in.

func (*AzureClients) SubscriptionID

func (c *AzureClients) SubscriptionID() string

SubscriptionID returns the Azure subscription id of the cluster, either specified or from the environment

func (*AzureClients) TenantID added in v0.4.7

func (c *AzureClients) TenantID() string

TenantID returns the Azure tenant id the controller runs in.

type ClusterScope

type ClusterScope struct {
	logr.Logger
	Client client.Client

	AzureClients
	Cluster      *clusterv1.Cluster
	AzureCluster *infrav1.AzureCluster
	// 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) AdditionalTags

func (s *ClusterScope) AdditionalTags() infrav1.Tags

AdditionalTags returns AdditionalTags from the scope's AzureCluster.

func (*ClusterScope) Authorizer added in v0.4.6

func (s *ClusterScope) Authorizer() autorest.Authorizer

Authorizer returns the Azure client Authorizer.

func (*ClusterScope) BaseURI added in v0.4.6

func (s *ClusterScope) BaseURI() string

BaseURI returns the Azure ResourceManagerEndpoint.

func (*ClusterScope) Close

func (s *ClusterScope) Close(ctx context.Context) error

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

func (*ClusterScope) ClusterName added in v0.4.6

func (s *ClusterScope) ClusterName() string

ClusterName returns the cluster name.

func (*ClusterScope) ControlPlaneSubnet

func (s *ClusterScope) ControlPlaneSubnet() *infrav1.SubnetSpec

ControlPlaneSubnet returns the cluster control plane subnet.

func (*ClusterScope) GenerateFQDN added in v0.4.6

func (s *ClusterScope) GenerateFQDN() string

GenerateFQDN generates a fully qualified domain name, based on the public IP name and cluster location.

func (*ClusterScope) IsIPv6Enabled added in v0.4.9

func (s *ClusterScope) IsIPv6Enabled() bool

IsIPv6Enabled returns true if IPv6 is enabled.

func (*ClusterScope) IsVnetManaged added in v0.4.7

func (s *ClusterScope) IsVnetManaged() bool

IsVnetManaged returns true if the vnet is managed.

func (*ClusterScope) LBSpecs added in v0.4.6

func (s *ClusterScope) LBSpecs() []azure.LBSpec

LBSpecs returns the load balancer specs.

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) NSGSpecs added in v0.4.7

func (s *ClusterScope) NSGSpecs() []azure.NSGSpec

NSGSpecs returns the security group specs.

func (*ClusterScope) Namespace

func (s *ClusterScope) Namespace() string

Namespace returns the cluster namespace.

func (*ClusterScope) Network

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

Network returns the cluster network object.

func (*ClusterScope) NodeSubnet

func (s *ClusterScope) NodeSubnet() *infrav1.SubnetSpec

NodeSubnet returns the cluster node subnet.

func (*ClusterScope) PatchObject added in v0.4.0

func (s *ClusterScope) PatchObject(ctx context.Context) error

PatchObject persists the cluster configuration and status.

func (*ClusterScope) PublicIPSpecs added in v0.4.6

func (s *ClusterScope) PublicIPSpecs() []azure.PublicIPSpec

PublicIPSpecs returns the public IP specs.

func (*ClusterScope) ResourceGroup

func (s *ClusterScope) ResourceGroup() string

ResourceGroup returns the cluster resource group.

func (*ClusterScope) RouteTable added in v0.4.7

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

RouteTable returns the cluster node routetable.

func (*ClusterScope) RouteTableSpecs added in v0.4.7

func (s *ClusterScope) RouteTableSpecs() []azure.RouteTableSpec

RouteTableSpecs returns the node route table(s)

func (*ClusterScope) SetControlPlaneIngressRules added in v0.4.7

func (s *ClusterScope) SetControlPlaneIngressRules()

func (*ClusterScope) SetFailureDomain added in v0.4.3

func (s *ClusterScope) SetFailureDomain(id string, spec clusterv1.FailureDomainSpec)

SetFailureDomain will set the spec for a for a given key

func (*ClusterScope) SubnetSpecs added in v0.4.7

func (s *ClusterScope) SubnetSpecs() []azure.SubnetSpec

SubnetSpecs returns the subnets specs.

func (*ClusterScope) Subnets

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

Subnets returns the cluster subnets.

func (*ClusterScope) VNetSpecs added in v0.4.7

func (s *ClusterScope) VNetSpecs() []azure.VNetSpec

/ VNetSpecs returns the virtual network specs.

func (*ClusterScope) Vnet

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

Vnet returns the cluster Vnet.

type ClusterScopeParams

type ClusterScopeParams struct {
	AzureClients
	Client       client.Client
	Logger       logr.Logger
	Cluster      *clusterv1.Cluster
	AzureCluster *infrav1.AzureCluster
}

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

type MachinePoolScope added in v0.4.3

type MachinePoolScope struct {
	logr.Logger

	MachinePool      *capiv1exp.MachinePool
	AzureMachinePool *infrav1exp.AzureMachinePool
	azure.ClusterDescriber
	// contains filtered or unexported fields
}

MachinePoolScope defines a scope defined around a machine pool and its cluster.

func NewMachinePoolScope added in v0.4.3

func NewMachinePoolScope(params MachinePoolScopeParams) (*MachinePoolScope, error)

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

func (*MachinePoolScope) AdditionalTags added in v0.4.3

func (m *MachinePoolScope) AdditionalTags() infrav1.Tags

AdditionalTags merges AdditionalTags from the scope's AzureCluster and AzureMachinePool. If the same key is present in both, the value from AzureMachinePool takes precedence.

func (*MachinePoolScope) AzureMachineTemplate added in v0.4.3

func (m *MachinePoolScope) AzureMachineTemplate(ctx context.Context) (*infrav1.AzureMachineTemplate, error)

func (*MachinePoolScope) Close added in v0.4.3

func (m *MachinePoolScope) Close(ctx context.Context) error

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

func (*MachinePoolScope) GetBootstrapData added in v0.4.3

func (m *MachinePoolScope) GetBootstrapData(ctx context.Context) (string, error)

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

func (*MachinePoolScope) GetVMImage added in v0.4.7

func (m *MachinePoolScope) GetVMImage() (*infrav1.Image, error)

Pick image from the machine configuration, or use a default one.

func (*MachinePoolScope) Name added in v0.4.3

func (m *MachinePoolScope) Name() string

Name returns the Azure Machine Pool Name.

func (*MachinePoolScope) PatchObject added in v0.4.3

func (m *MachinePoolScope) PatchObject(ctx context.Context) error

PatchObject persists the machine spec and status.

func (*MachinePoolScope) ProviderID added in v0.4.8

func (m *MachinePoolScope) ProviderID() string

ProviderID returns the AzureMachinePool ID by parsing Spec.ProviderID.

func (*MachinePoolScope) ProvisioningState added in v0.4.8

func (m *MachinePoolScope) ProvisioningState() infrav1.VMState

ProvisioningState returns the AzureMachinePool provisioning state.

func (*MachinePoolScope) ScaleSetSpec added in v0.4.8

func (m *MachinePoolScope) ScaleSetSpec() azure.ScaleSetSpec

ScaleSetSpec returns the scale set spec.

func (*MachinePoolScope) SetAnnotation added in v0.4.3

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

SetAnnotation sets a key value annotation on the AzureMachinePool.

func (*MachinePoolScope) SetFailureMessage added in v0.4.3

func (m *MachinePoolScope) SetFailureMessage(v error)

SetFailureMessage sets the AzureMachinePool status failure message.

func (*MachinePoolScope) SetFailureReason added in v0.4.3

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

SetFailureReason sets the AzureMachinePool status failure reason.

func (*MachinePoolScope) SetNotReady added in v0.4.8

func (m *MachinePoolScope) SetNotReady()

SetNotReady sets the AzureMachinePool Ready Status to false.

func (*MachinePoolScope) SetProviderID added in v0.4.8

func (m *MachinePoolScope) SetProviderID(v string)

SetProviderID sets the AzureMachine providerID in spec.

func (*MachinePoolScope) SetProvisioningState added in v0.4.8

func (m *MachinePoolScope) SetProvisioningState(v infrav1.VMState)

SetProvisioningState sets the AzureMachinePool provisioning state.

func (*MachinePoolScope) SetReady added in v0.4.3

func (m *MachinePoolScope) SetReady()

SetReady sets the AzureMachinePool Ready Status to true.

type MachinePoolScopeParams added in v0.4.3

type MachinePoolScopeParams struct {
	Client           client.Client
	Logger           logr.Logger
	MachinePool      *capiv1exp.MachinePool
	AzureMachinePool *infrav1exp.AzureMachinePool
	ClusterDescriber azure.ClusterDescriber
}

MachinePoolScopeParams defines the input parameters used to create a new MachinePoolScope.

type MachineScope

type MachineScope struct {
	logr.Logger

	azure.ClusterDescriber
	Machine      *clusterv1.Machine
	AzureMachine *infrav1.AzureMachine
	// 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) AdditionalTags

func (m *MachineScope) AdditionalTags() infrav1.Tags

AdditionalTags merges AdditionalTags from the scope's AzureCluster and AzureMachine. If the same key is present in both, the value from AzureMachine takes precedence.

func (*MachineScope) AnnotationJSON added in v0.4.8

func (m *MachineScope) AnnotationJSON(annotation string) (map[string]interface{}, error)

AnnotationJSON returns a map[string]interface from a JSON annotation.

func (*MachineScope) AvailabilityZone

func (m *MachineScope) AvailabilityZone() string

AvailabilityZone returns the AzureMachine Availability Zone. Priority for selecting the AZ is

  1. Machine.Spec.FailureDomain
  2. AzureMachine.Spec.FailureDomain (This is to support deprecated AZ)
  3. AzureMachine.Spec.AvailabilityZone.ID (This is DEPRECATED)
  4. No AZ

func (*MachineScope) BastionSpecs added in v0.4.8

func (m *MachineScope) BastionSpecs() []azure.BastionSpec

BastionSpecs returns the bastion specs.

func (*MachineScope) Close

func (m *MachineScope) Close(ctx context.Context) error

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

func (*MachineScope) DiskSpecs added in v0.4.6

func (m *MachineScope) DiskSpecs() []azure.DiskSpec

DiskSpecs returns the disk specs.

func (*MachineScope) GetBootstrapData added in v0.4.0

func (m *MachineScope) GetBootstrapData(ctx context.Context) (string, error)

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

func (*MachineScope) GetVMID

func (m *MachineScope) GetVMID() string

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

func (*MachineScope) GetVMImage added in v0.4.7

func (m *MachineScope) GetVMImage() (*infrav1.Image, error)

GetVMImage returns the image from the machine configuration, or a default one.

func (*MachineScope) InboundNatSpecs added in v0.4.7

func (m *MachineScope) InboundNatSpecs() []azure.InboundNatSpec

InboundNatSpecs returns the inbound NAT specs.

func (*MachineScope) IsControlPlane

func (m *MachineScope) IsControlPlane() bool

IsControlPlane returns true if the machine is a control plane.

func (*MachineScope) NICNames added in v0.4.7

func (m *MachineScope) NICNames() []string

NICNames returns the NIC names

func (*MachineScope) NICSpecs added in v0.4.6

func (m *MachineScope) NICSpecs() []azure.NICSpec

NICSpecs returns the network interface specs.

func (*MachineScope) Name

func (m *MachineScope) Name() string

Name returns the AzureMachine name.

func (*MachineScope) Namespace

func (m *MachineScope) Namespace() string

Namespace returns the namespace name.

func (*MachineScope) PatchObject added in v0.4.0

func (m *MachineScope) PatchObject(ctx context.Context) error

PatchObject persists the machine spec and status.

func (*MachineScope) ProviderID added in v0.4.8

func (m *MachineScope) ProviderID() string

ProviderID returns the AzureMachine providerID from the spec.

func (*MachineScope) PublicIPSpecs added in v0.4.6

func (m *MachineScope) PublicIPSpecs() []azure.PublicIPSpec

PublicIPSpecs returns the public IP specs.

func (*MachineScope) Role

func (m *MachineScope) Role() string

Role returns the machine role from the labels.

func (*MachineScope) RoleAssignmentSpecs added in v0.4.7

func (m *MachineScope) RoleAssignmentSpecs() []azure.RoleAssignmentSpec

RoleAssignmentSpecs returns the role assignment specs.

func (*MachineScope) SetAddresses

func (m *MachineScope) SetAddresses(addrs []corev1.NodeAddress)

SetAddresses sets the Azure address status.

func (*MachineScope) SetAnnotation

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

SetAnnotation sets a key value annotation on the AzureMachine.

func (*MachineScope) SetFailureMessage added in v0.4.0

func (m *MachineScope) SetFailureMessage(v error)

SetFailureMessage sets the AzureMachine status failure message.

func (*MachineScope) SetFailureReason added in v0.4.0

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

SetFailureReason sets the AzureMachine status failure reason.

func (*MachineScope) SetNotReady added in v0.4.2

func (m *MachineScope) SetNotReady()

SetNotReady sets the AzureMachine Ready Status to false.

func (*MachineScope) SetProviderID

func (m *MachineScope) SetProviderID(v string)

SetProviderID sets the AzureMachine providerID in spec.

func (*MachineScope) SetReady

func (m *MachineScope) SetReady()

SetReady sets the AzureMachine Ready Status to true.

func (*MachineScope) SetVMState

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

SetVMState sets the AzureMachine VM state.

func (*MachineScope) Subnet added in v0.4.6

func (m *MachineScope) Subnet() *infrav1.SubnetSpec

Subnet returns the machine's subnet based on its role

func (*MachineScope) TagsSpecs added in v0.4.8

func (m *MachineScope) TagsSpecs() []azure.TagsSpec

TagsSpecs returns the tags for the AzureMachine.

func (*MachineScope) UpdateAnnotationJSON added in v0.4.8

func (m *MachineScope) UpdateAnnotationJSON(annotation string, content map[string]interface{}) error

UpdateAnnotationJSON updates the `annotation` with `content`. `content` in this case should be a `map[string]interface{}` suitable for turning into JSON. This `content` map will be marshalled into a JSON string before being set as the given `annotation`.

func (*MachineScope) VMSpecs added in v0.4.7

func (m *MachineScope) VMSpecs() []azure.VMSpec

VMSpecs returns the VM specs.

func (*MachineScope) VMState added in v0.4.8

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

VMState returns the AzureMachine VM state.

type MachineScopeParams

type MachineScopeParams struct {
	Client           client.Client
	Logger           logr.Logger
	ClusterDescriber azure.ClusterDescriber
	Machine          *clusterv1.Machine
	AzureMachine     *infrav1.AzureMachine
}

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

type ManagedControlPlaneScope added in v0.4.4

type ManagedControlPlaneScope struct {
	logr.Logger
	Client client.Client

	AzureClients
	Cluster          *clusterv1.Cluster
	MachinePool      *expv1.MachinePool
	ControlPlane     *infrav1exp.AzureManagedControlPlane
	InfraMachinePool *infrav1exp.AzureManagedMachinePool
	PatchTarget      runtime.Object
	// contains filtered or unexported fields
}

ManagedControlPlaneScope defines the basic context for an actuator to operate upon.

func NewManagedControlPlaneScope added in v0.4.4

func NewManagedControlPlaneScope(params ManagedControlPlaneScopeParams) (*ManagedControlPlaneScope, error)

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

func (*ManagedControlPlaneScope) AdditionalTags added in v0.4.7

func (s *ManagedControlPlaneScope) AdditionalTags() infrav1.Tags

AdditionalTags returns AdditionalTags from the ControlPlane spec.

func (*ManagedControlPlaneScope) Authorizer added in v0.4.6

Authorizer returns the Azure client Authorizer.

func (*ManagedControlPlaneScope) BaseURI added in v0.4.6

func (s *ManagedControlPlaneScope) BaseURI() string

BaseURI returns the Azure ResourceManagerEndpoint.

func (*ManagedControlPlaneScope) ClusterName added in v0.4.7

func (s *ManagedControlPlaneScope) ClusterName() string

func (*ManagedControlPlaneScope) Location added in v0.4.7

func (s *ManagedControlPlaneScope) Location() string

func (*ManagedControlPlaneScope) PatchObject added in v0.4.4

func (s *ManagedControlPlaneScope) PatchObject(ctx context.Context) error

PatchObject persists the cluster configuration and status.

func (*ManagedControlPlaneScope) ResourceGroup added in v0.4.7

func (s *ManagedControlPlaneScope) ResourceGroup() string

func (*ManagedControlPlaneScope) SubscriptionID added in v0.4.6

func (s *ManagedControlPlaneScope) SubscriptionID() string

SubscriptionID returns the Azure client Subscription ID.

type ManagedControlPlaneScopeParams added in v0.4.4

type ManagedControlPlaneScopeParams struct {
	AzureClients
	Client           client.Client
	Logger           logr.Logger
	Cluster          *clusterv1.Cluster
	ControlPlane     *infrav1exp.AzureManagedControlPlane
	InfraMachinePool *infrav1exp.AzureManagedMachinePool
	MachinePool      *expv1.MachinePool
	PatchTarget      runtime.Object
}

ManagedControlPlaneScopeParams defines the input parameters used to create a new

Jump to

Keyboard shortcuts

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