scope

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package scope implements scope types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterScope

type ClusterScope struct {
	Cluster    *clusterv1.Cluster
	GCPCluster *infrav1.GCPCluster
	GCPServices
	// 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) AdditionalLabels added in v0.4.0

func (s *ClusterScope) AdditionalLabels() infrav1.Labels

AdditionalLabels returns the cluster additional labels.

func (*ClusterScope) AddressSpec added in v0.4.0

func (s *ClusterScope) AddressSpec() *compute.Address

AddressSpec returns google compute address spec.

func (*ClusterScope) BackendServiceSpec added in v0.4.0

func (s *ClusterScope) BackendServiceSpec() *compute.BackendService

BackendServiceSpec returns google compute backend-service spec.

func (*ClusterScope) Close

func (s *ClusterScope) Close() error

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

func (*ClusterScope) Cloud added in v0.4.0

func (s *ClusterScope) Cloud() cloud.Cloud

Cloud returns initialized cloud.

func (*ClusterScope) ControlPlaneEndpoint added in v0.4.0

func (s *ClusterScope) ControlPlaneEndpoint() clusterv1.APIEndpoint

ControlPlaneEndpoint returns the cluster control-plane endpoint.

func (*ClusterScope) FailureDomains added in v0.4.0

func (s *ClusterScope) FailureDomains() clusterv1.FailureDomains

FailureDomains returns the cluster failure domains.

func (*ClusterScope) FirewallRulesSpec added in v0.4.0

func (s *ClusterScope) FirewallRulesSpec() []*compute.Firewall

FirewallRulesSpec returns google compute firewall spec.

func (*ClusterScope) ForwardingRuleSpec added in v0.4.0

func (s *ClusterScope) ForwardingRuleSpec() *compute.ForwardingRule

ForwardingRuleSpec returns google compute forwarding-rule spec.

func (*ClusterScope) HealthCheckSpec added in v0.4.0

func (s *ClusterScope) HealthCheckSpec() *compute.HealthCheck

HealthCheckSpec returns google compute health-check spec.

func (*ClusterScope) InstanceGroupSpec added in v0.4.0

func (s *ClusterScope) InstanceGroupSpec(zone string) *compute.InstanceGroup

InstanceGroupSpec returns google compute instance-group spec.

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) NatRouterSpec added in v0.4.0

func (s *ClusterScope) NatRouterSpec() *compute.Router

NatRouterSpec returns google compute nat router spec.

func (*ClusterScope) Network

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

Network returns the cluster network object.

func (s *ClusterScope) NetworkLink() string

NetworkLink returns the partial URL for the network.

func (*ClusterScope) NetworkName

func (s *ClusterScope) NetworkName() string

NetworkName returns the cluster network unique identifier.

func (*ClusterScope) NetworkSpec added in v0.4.0

func (s *ClusterScope) NetworkSpec() *compute.Network

NetworkSpec returns google compute network spec.

func (*ClusterScope) PatchObject

func (s *ClusterScope) PatchObject() error

PatchObject persists the cluster configuration and status.

func (*ClusterScope) Project

func (s *ClusterScope) Project() string

Project returns the current project name.

func (*ClusterScope) Region

func (s *ClusterScope) Region() string

Region returns the cluster region.

func (*ClusterScope) SetControlPlaneEndpoint added in v0.4.0

func (s *ClusterScope) SetControlPlaneEndpoint(endpoint clusterv1.APIEndpoint)

SetControlPlaneEndpoint sets cluster control-plane endpoint.

func (*ClusterScope) SetFailureDomains added in v0.4.0

func (s *ClusterScope) SetFailureDomains(fd clusterv1.FailureDomains)

SetFailureDomains sets cluster failure domains.

func (*ClusterScope) SetReady added in v0.4.0

func (s *ClusterScope) SetReady()

SetReady sets cluster ready status.

func (*ClusterScope) SubnetSpecs added in v1.2.0

func (s *ClusterScope) SubnetSpecs() []*compute.Subnetwork

SubnetSpecs returns google compute subnets spec.

func (*ClusterScope) TargetTCPProxySpec added in v0.4.0

func (s *ClusterScope) TargetTCPProxySpec() *compute.TargetTcpProxy

TargetTCPProxySpec returns google compute target-tcp-proxy spec.

type ClusterScopeGetter

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

ClusterScopeGetter is a Service which knows how to retrieve the scope for a cluster.

type ClusterScopeGetterFunc

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

ClusterScopeGetterFunc ...

func (ClusterScopeGetterFunc) ClusterScope

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

ClusterScope returns the cluster scope.

type ClusterScopeParams

type ClusterScopeParams struct {
	GCPServices
	Client     client.Client
	Cluster    *clusterv1.Cluster
	GCPCluster *infrav1.GCPCluster
}

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

type GCPRateLimiter added in v0.4.0

type GCPRateLimiter struct{}

GCPRateLimiter implements cloud.RateLimiter.

func (*GCPRateLimiter) Accept added in v0.4.0

func (rl *GCPRateLimiter) Accept(ctx context.Context, key *cloud.RateLimitKey) error

Accept blocks until the operation can be performed.

type GCPServices added in v0.4.0

type GCPServices struct {
	Compute *compute.Service
}

GCPServices contains all the gcp services used by the scopes.

type MachineScope

type MachineScope struct {
	ClusterGetter cloud.ClusterGetter
	Machine       *clusterv1.Machine
	GCPMachine    *infrav1.GCPMachine
	// 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) Close

func (m *MachineScope) Close() error

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

func (*MachineScope) Cloud added in v0.4.0

func (m *MachineScope) Cloud() cloud.Cloud

Cloud returns initialized cloud.

func (*MachineScope) ControlPlaneGroupName added in v0.4.0

func (m *MachineScope) ControlPlaneGroupName() string

ControlPlaneGroupName returns the control-plane instance group name.

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) GetInstanceID

func (m *MachineScope) GetInstanceID() *string

GetInstanceID returns the GCPMachine instance id by parsing Spec.ProviderID.

func (*MachineScope) GetInstanceStatus

func (m *MachineScope) GetInstanceStatus() *infrav1.InstanceStatus

GetInstanceStatus returns the GCPMachine instance status.

func (*MachineScope) GetProviderID

func (m *MachineScope) GetProviderID() string

GetProviderID returns the GCPMachine providerID from the spec.

func (*MachineScope) InstanceAdditionalDiskSpec added in v0.4.0

func (m *MachineScope) InstanceAdditionalDiskSpec() []*compute.AttachedDisk

InstanceAdditionalDiskSpec returns compute instance additional attched-disk spec.

func (*MachineScope) InstanceAdditionalMetadataSpec added in v0.4.0

func (m *MachineScope) InstanceAdditionalMetadataSpec() *compute.Metadata

InstanceAdditionalMetadataSpec returns additional metadata spec.

func (*MachineScope) InstanceImageSpec added in v0.4.0

func (m *MachineScope) InstanceImageSpec() *compute.AttachedDisk

InstanceImageSpec returns compute instance image attched-disk spec.

func (*MachineScope) InstanceNetworkInterfaceSpec added in v0.4.0

func (m *MachineScope) InstanceNetworkInterfaceSpec() *compute.NetworkInterface

InstanceNetworkInterfaceSpec returns compute network interface spec.

func (*MachineScope) InstanceServiceAccountsSpec added in v0.4.0

func (m *MachineScope) InstanceServiceAccountsSpec() *compute.ServiceAccount

InstanceServiceAccountsSpec returns service-account spec.

func (*MachineScope) InstanceSpec added in v0.4.0

func (m *MachineScope) InstanceSpec() *compute.Instance

InstanceSpec returns instance spec.

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 GCPMachine 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 cluster configuration and status.

func (*MachineScope) Project added in v1.1.0

func (m *MachineScope) Project() string

Project return the project for the GCPMachine's cluster.

func (*MachineScope) Role

func (m *MachineScope) Role() string

Role returns the machine role from the labels.

func (*MachineScope) SetAddresses

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

SetAddresses sets the addresses field on the GCPMachine.

func (*MachineScope) SetAnnotation

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

SetAnnotation sets a key value annotation on the GCPMachine.

func (*MachineScope) SetFailureMessage

func (m *MachineScope) SetFailureMessage(v error)

SetFailureMessage sets the GCPMachine status failure message.

func (*MachineScope) SetFailureReason

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

SetFailureReason sets the GCPMachine status failure reason.

func (*MachineScope) SetInstanceStatus

func (m *MachineScope) SetInstanceStatus(v infrav1.InstanceStatus)

SetInstanceStatus sets the GCPMachine instance status.

func (*MachineScope) SetProviderID

func (m *MachineScope) SetProviderID()

SetProviderID sets the GCPMachine providerID in spec.

func (*MachineScope) SetReady

func (m *MachineScope) SetReady()

SetReady sets the GCPMachine Ready Status.

func (*MachineScope) Zone

func (m *MachineScope) Zone() string

Zone returns the FailureDomain for the GCPMachine.

type MachineScopeGetter

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

MachineScopeGetter ...

type MachineScopeGetterFunc

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

MachineScopeGetterFunc ...

func (MachineScopeGetterFunc) MachineScope

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

MachineScope returns the machine scope.

type MachineScopeParams

type MachineScopeParams struct {
	Client        client.Client
	ClusterGetter cloud.ClusterGetter
	Machine       *clusterv1.Machine
	GCPMachine    *infrav1.GCPMachine
}

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

Jump to

Keyboard shortcuts

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