scope

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 60 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AvailabilityDomain                = "AvailabilityDomain"
	FaultDomain                       = "FaultDomain"
	OCIClusterKind                    = "OCICluster"
	OCIManagedClusterKind             = "OCIManagedCluster"
	OCIManagedClusterControlPlaneKind = "OCIManagedClusterControlPlane"
)
View Source
const (
	VcnDefaultCidr                        = "10.0.0.0/16"
	ControlPlaneEndpointSubnetDefaultCIDR = "10.0.0.8/29"
	ControlPlaneMachineSubnetDefaultCIDR  = "10.0.0.0/29"
	WorkerSubnetDefaultCIDR               = "10.0.64.0/20"
	ServiceLoadBalancerDefaultCIDR        = "10.0.0.32/27"
	ApiServerPort                         = 6443
	APIServerLBBackendSetName             = "apiserver-lb-backendset"
	APIServerLBListener                   = "apiserver-lb-listener"
	SGWServiceSuffix                      = "-services-in-oracle-services-network"
	ServiceGatewayName                    = "service-gateway"
	PublicRouteTableName                  = "public-route-table"
	PrivateRouteTableName                 = "private-route-table"
	NatGatewayName                        = "nat-gateway"
	InternetGatewayName                   = "internet-gateway"
	ControlPlaneEndpointDefaultName       = "control-plane-endpoint"
	ControlPlaneDefaultName               = "control-plane"
	WorkerDefaultName                     = "worker"
	ServiceLBDefaultName                  = "service-lb"
)
View Source
const (
	PollInterval   = 5 * time.Second
	RequestTimeout = 2 * time.Minute
)
View Source
const (
	LogLevelWarn = 3
)
View Source
const OCIMachineKind = "OCIMachine"
View Source
const OCIMachinePoolKind = "OCIMachinePool"
View Source
const (
	OCIManagedMachinePoolKind = "OCIManagedMachinePool"
)
View Source
const (
	OCIVirtualMachinePoolKind = "OCIVirtualMachinePool"
)
View Source
const (
	// OKEInitScript is the cloud init script of OKE slef managed node:
	// Reference : https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengcloudinitforselfmanagednodes.htm
	OKEInitScript = "" /* 136-byte string literal not displayed */
)

Variables

View Source
var (
	MockTestRegion = "us-lexington-1"
)

Functions

func ConvertMachineDefinedTags added in v0.7.0

func ConvertMachineDefinedTags(machineDefinedTags map[string]map[string]string) map[string]map[string]interface{}

ConvertMachineDefinedTags passes in the OCIMachineSpec DefinedTags and returns a converted map of defined tags to be used when creating API requests.

func GetNsgNamesFromId added in v0.6.0

func GetNsgNamesFromId(ids []string, nsgs []*infrastructurev1beta2.NSG) []string

GetNsgNamesFromId returns the names of the NSGs with the provided IDs

func GetRegionCodeFromRegion added in v0.6.0

func GetRegionCodeFromRegion(ctx context.Context, identityClient identityClient.Client, region string) (string, error)

GetRegionCodeFromRegion pulls all OCI regions available and returns the passed in region's code if contained in the list.

example: "ca-toronto-1" -> "YYZ"

func GetSubnetNameFromId added in v0.6.0

func GetSubnetNameFromId(id *string, subnets []*infrastructurev1beta2.Subnet) string

GetSubnetNameFromId returns the name of the Subnet with the provided ID

func GetSubnetNamesFromId added in v0.6.0

func GetSubnetNamesFromId(ids []string, subnets []*infrastructurev1beta2.Subnet) []string

GetSubnetNamesFromId returns the names of the Subnets with the provided IDs

func MockAuthConfig added in v0.2.0

func MockAuthConfig() (config.AuthConfig, error)

Types

type ClientProvider added in v0.2.0

type ClientProvider struct {
	*logr.Logger
	// contains filtered or unexported fields
}

ClientProvider defines the regional clients

func MockNewClientProvider added in v0.2.0

func MockNewClientProvider(mockClients MockOCIClients) (*ClientProvider, error)

func NewClientProvider added in v0.2.0

func NewClientProvider(params ClientProviderParams) (*ClientProvider, error)

NewClientProvider builds the ClientProvider with a client for the given region

func (*ClientProvider) GetAuthProvider added in v0.9.0

func (c *ClientProvider) GetAuthProvider() common.ConfigurationProvider

GetAuthProvider returns the client provider auth config

func (*ClientProvider) GetOrBuildClient added in v0.2.0

func (c *ClientProvider) GetOrBuildClient(region string) (OCIClients, error)

GetOrBuildClient if the OCIClients exist for the region they are returned, if not clients will build them

func (*ClientProvider) GetRegion added in v0.7.0

func (c *ClientProvider) GetRegion() (string, error)

GetRegion returns the region from the authentication config provider

type ClientProviderParams added in v0.9.0

type ClientProviderParams struct {
	// OciAuthConfigProvider wraps information about the account owner
	OciAuthConfigProvider common.ConfigurationProvider

	// ClientOverrides contains information about client host url overrides.
	ClientOverrides *v1beta2.ClientOverrides

	// CertOverride a x509 CertPool to use as an override for client TLSClientConfig
	CertOverride *x509.CertPool
}

ClientProviderParams is the params struct for NewClientProvider

type ClusterScope

type ClusterScope struct {
	*logr.Logger

	Cluster                   *clusterv1.Cluster
	VCNClient                 vcn.Client
	NetworkLoadBalancerClient nlb.NetworkLoadBalancerClient
	LoadBalancerClient        lb.LoadBalancerClient
	IdentityClient            identityClient.Client
	// RegionIdentifier Identifier as specified here https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm
	RegionIdentifier   string
	ClientProvider     *ClientProvider
	OCIClusterAccessor OCIClusterAccessor
	// RegionIdentifier Key as specified here https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm
	RegionKey string
	// contains filtered or unexported fields
}

func NewClusterScope

func NewClusterScope(params ClusterScopeParams) (*ClusterScope, error)

NewClusterScope creates a ClusterScope given the ClusterScopeParams

func (*ClusterScope) APIServerPort

func (s *ClusterScope) APIServerPort() int32

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

func (*ClusterScope) CreateInternetGateway

func (s *ClusterScope) CreateInternetGateway(ctx context.Context) (*string, error)

CreateInternetGateway creates the Internet Gateway for the cluster based on the ClusterScope

func (*ClusterScope) CreateLB

CreateLB configures and creates the Load Balancer for the cluster based on the ClusterScope. This configures the LB Listeners and Backend Sets in order to create the Load Balancer. It will await the Work Request completion before returning

See https://docs.oracle.com/en-us/iaas/Content/LoadBalancer/overview.htm for more details on the Network Load Balancer

func (*ClusterScope) CreateNLB added in v0.9.0

CreateNLB configures and creates the Network Load Balancer for the cluster based on the ClusterScope. This configures the LB Listeners and Backend Sets in order to create the Network Load Balancer. It will await the Work Request completion before returning

See https://docs.oracle.com/en-us/iaas/Content/NetworkLoadBalancer/overview.htm for more details on the Network Load Balancer

func (*ClusterScope) CreateNSG

func (s *ClusterScope) CreateNSG(ctx context.Context, nsg infrastructurev1beta2.NSG) (*string, error)

func (*ClusterScope) CreateNatGateway

func (s *ClusterScope) CreateNatGateway(ctx context.Context) (*string, error)

CreateNatGateway creates the NAT Gateway for the cluster based on the ClusterScope

func (*ClusterScope) CreateRouteTable

func (s *ClusterScope) CreateRouteTable(ctx context.Context, routeTableType string) (*string, error)

func (*ClusterScope) CreateSecurityList

func (s *ClusterScope) CreateSecurityList(ctx context.Context, secList infrastructurev1beta2.SecurityList) (*string, error)

func (*ClusterScope) CreateServiceGateway

func (s *ClusterScope) CreateServiceGateway(ctx context.Context) (*string, error)

func (*ClusterScope) CreateSubnet

func (s *ClusterScope) CreateSubnet(ctx context.Context, spec infrastructurev1beta2.Subnet) (*string, error)

func (*ClusterScope) CreateVCN

func (s *ClusterScope) CreateVCN(ctx context.Context, spec infrastructurev1beta2.VCN) (*string, error)

func (*ClusterScope) DeleteApiServerLB

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

DeleteApiServerLB retrieves and attempts to delete the Load Balancer if found. It will await the Work Request completion before returning

func (*ClusterScope) DeleteApiServerNLB added in v0.9.0

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

DeleteApiServerNLB retrieves and attempts to delete the Network Load Balancer if found. It will await the Work Request completion before returning

func (*ClusterScope) DeleteDRG added in v0.3.0

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

DeleteDRG tries to delete the DRG

func (*ClusterScope) DeleteDRGRPCAttachment added in v0.3.0

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

DeleteDRGRPCAttachment deletes DRG RPC attachments

func (*ClusterScope) DeleteDRGVCNAttachment added in v0.3.0

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

func (*ClusterScope) DeleteInternetGateway

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

DeleteInternetGateway retrieves and attempts to delete the Internet Gateway if found.

func (*ClusterScope) DeleteNSGs

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

func (*ClusterScope) DeleteNatGateway

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

DeleteNatGateway retrieves and attempts to delete the NAT Gateway if found.

func (*ClusterScope) DeleteRouteTables

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

func (*ClusterScope) DeleteSecurityLists

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

func (*ClusterScope) DeleteServiceGateway

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

func (*ClusterScope) DeleteSubnets

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

func (*ClusterScope) DeleteVCN

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

func (*ClusterScope) GetCompartmentId

func (s *ClusterScope) GetCompartmentId() string

GetCompartmentId returns the CompartmentId defined in OCICluster's spec

func (*ClusterScope) GetControlPlaneEndpointSubnet

func (s *ClusterScope) GetControlPlaneEndpointSubnet() *infrastructurev1beta2.Subnet

func (*ClusterScope) GetControlPlaneEndpointSubnetCidr

func (s *ClusterScope) GetControlPlaneEndpointSubnetCidr() string

func (*ClusterScope) GetControlPlaneLbsLoadBalancerName added in v0.9.0

func (s *ClusterScope) GetControlPlaneLbsLoadBalancerName() string

GetControlPlaneLoadBalancerName returns the user defined APIServerLB name from the spec or assigns the name based on the OCICluster's name

func (*ClusterScope) GetControlPlaneLoadBalancerName

func (s *ClusterScope) GetControlPlaneLoadBalancerName() string

GetControlPlaneLoadBalancerName returns the user defined APIServerLB name from the spec or assigns the name based on the OCICluster's name

func (*ClusterScope) GetControlPlaneMachineSubnet

func (s *ClusterScope) GetControlPlaneMachineSubnet() *infrastructurev1beta2.Subnet

func (*ClusterScope) GetControlPlaneMachineSubnetCidr

func (s *ClusterScope) GetControlPlaneMachineSubnetCidr() string

func (*ClusterScope) GetDRG added in v0.3.0

func (s *ClusterScope) GetDRG(ctx context.Context) (*core.Drg, error)

GetDRG retrieves the Cluster's core.Drg using the one of the following methods

1. the OCICluster's spec Drg

2. Listing the Drgs for the Compartment (by ID) and filtering by tag

func (*ClusterScope) GetDRGAttachment added in v0.3.0

func (s *ClusterScope) GetDRGAttachment(ctx context.Context) (*core.DrgAttachment, error)

func (*ClusterScope) GetDRGName added in v0.3.0

func (s *ClusterScope) GetDRGName() string

func (*ClusterScope) GetDefinedTags

func (s *ClusterScope) GetDefinedTags() map[string]map[string]interface{}

GetDefinedTags returns a map of DefinedTags defined in the OCICluster's spec

func (*ClusterScope) GetDesiredRouteTables

func (s *ClusterScope) GetDesiredRouteTables() []string

func (*ClusterScope) GetFreeFormTags

func (s *ClusterScope) GetFreeFormTags() map[string]string

GetFreeFormTags returns a map of FreeformTags defined in the OCICluster's spec

func (*ClusterScope) GetInternetGateway

func (s *ClusterScope) GetInternetGateway(ctx context.Context) (*core.InternetGateway, error)

GetInternetGateway retrieves the Cluster's core.InternetGateway using the one of the following methods

1. the OCICluster's spec InternetGatewayId

2. Listing the Internet Gateways for the Compartment (by ID) and filtering by tag

func (*ClusterScope) GetLoadBalancers added in v0.9.0

func (s *ClusterScope) GetLoadBalancers(ctx context.Context) (*loadbalancer.LoadBalancer, error)

GetLoadBalancers retrieves the Cluster's loadbalancer.LoadBalancer using the one of the following methods

1. the OCICluster's spec LoadBalancerId

2. Listing the LoadBalancers for the Compartment (by ID) and DisplayName then filtering by tag

func (*ClusterScope) GetNSG

func (*ClusterScope) GetNSGSpec

func (s *ClusterScope) GetNSGSpec() []*infrastructurev1beta2.NSG

func (*ClusterScope) GetNatGateway

func (s *ClusterScope) GetNatGateway(ctx context.Context) (*core.NatGateway, error)

GetNatGateway retrieves the Cluster's core.NatGateway using the one of the following methods

1. the OCICluster's spec NatGatewayId

2. Listing the NAT Gateways for the Compartment (by ID), VCN and DisplayName and filtering by tag

func (*ClusterScope) GetNetworkLoadBalancers added in v0.9.0

func (s *ClusterScope) GetNetworkLoadBalancers(ctx context.Context) (*networkloadbalancer.NetworkLoadBalancer, error)

GetNetworkLoadBalancers retrieves the Cluster's networkloadbalancer.NetworkLoadBalancer using the one of the following methods

1. the OCICluster's spec LoadBalancerId

2. Listing the NetworkLoadBalancers for the Compartment (by ID) and DisplayName then filtering by tag

func (*ClusterScope) GetNodeSubnet

func (s *ClusterScope) GetNodeSubnet() []*infrastructurev1beta2.Subnet

func (*ClusterScope) GetOCIClusterAccessor added in v0.6.0

func (s *ClusterScope) GetOCIClusterAccessor() OCIClusterAccessor

func (*ClusterScope) GetSecurityList

func (*ClusterScope) GetServiceGateway

func (s *ClusterScope) GetServiceGateway(ctx context.Context) (*core.ServiceGateway, error)

func (*ClusterScope) GetServiceLoadBalancerSubnet

func (s *ClusterScope) GetServiceLoadBalancerSubnet() *infrastructurev1beta2.Subnet

func (*ClusterScope) GetServiceLoadBalancerSubnetCidr

func (s *ClusterScope) GetServiceLoadBalancerSubnetCidr() string

func (*ClusterScope) GetSubnet

func (*ClusterScope) GetSubnetsSpec

func (s *ClusterScope) GetSubnetsSpec() []*infrastructurev1beta2.Subnet

func (*ClusterScope) GetVCN

func (s *ClusterScope) GetVCN(ctx context.Context) (*core.Vcn, error)

func (*ClusterScope) GetVcnCidr

func (s *ClusterScope) GetVcnCidr() string

func (*ClusterScope) GetVcnName

func (s *ClusterScope) GetVcnName() string

func (*ClusterScope) IsAllSubnetsPrivate

func (s *ClusterScope) IsAllSubnetsPrivate() bool

IsAllSubnetsPrivate determines if all the ClusterScope's subnets are private

func (*ClusterScope) IsAllSubnetsPublic

func (s *ClusterScope) IsAllSubnetsPublic() bool

IsAllSubnetsPublic determines if all the ClusterScope's subnets are public

func (*ClusterScope) IsLBEqual

IsLBEqual determines if the actual loadbalancer.LoadBalancer is equal to the desired. Equality is determined by DisplayName, FreeformTags and DefinedTags matching.

func (*ClusterScope) IsNLBEqual added in v0.9.0

IsNLBEqual determines if the actual networkloadbalancer.NetworkLoadBalancer is equal to the desired. Equality is determined by DisplayName

func (*ClusterScope) IsNSGEqual

func (s *ClusterScope) IsNSGEqual(actual *core.NetworkSecurityGroup, desired infrastructurev1beta2.NSG) bool

IsNSGEqual compares the actual and desired NSG using name.

func (*ClusterScope) IsNSGExitsByRole

func (s *ClusterScope) IsNSGExitsByRole(role infrastructurev1beta2.Role) bool

func (*ClusterScope) IsResourceCreatedByClusterAPI

func (s *ClusterScope) IsResourceCreatedByClusterAPI(resourceFreeFormTags map[string]string) bool

func (*ClusterScope) IsSecurityListEqual

func (s *ClusterScope) IsSecurityListEqual(actual core.SecurityList, desired infrastructurev1beta2.SecurityList) bool

func (*ClusterScope) IsSecurityListExitsByRole

func (s *ClusterScope) IsSecurityListExitsByRole(role infrastructurev1beta2.Role) bool

func (*ClusterScope) IsSubnetsEqual

func (s *ClusterScope) IsSubnetsEqual(actual *core.Subnet, desired infrastructurev1beta2.Subnet) bool

func (*ClusterScope) IsVcnEquals

func (s *ClusterScope) IsVcnEquals(actual *core.Vcn, desired infrastructurev1beta2.VCN) bool

func (*ClusterScope) LBSpec

LBSpec builds the LoadBalancer from the ClusterScope and returns it

func (*ClusterScope) NLBSpec added in v0.9.0

NLBSpec builds the Network LoadBalancer from the ClusterScope and returns it

func (*ClusterScope) NodeSubnetCidr

func (s *ClusterScope) NodeSubnetCidr() []string

func (*ClusterScope) ReconcileApiServerLB

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

ReconcileApiServerLB tries to move the Load Balancer to the desired OCICluster Spec

func (*ClusterScope) ReconcileApiServerNLB added in v0.9.0

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

ReconcileApiServerNLB tries to move the Network Load Balancer to the desired OCICluster Spec

func (*ClusterScope) ReconcileDRG added in v0.3.0

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

ReconcileDRG tries to move the DRG to the desired OCICluster Spec

func (*ClusterScope) ReconcileDRGRPCAttachment added in v0.3.0

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

ReconcileDRGRPCAttachment reconciles DRG RPC attachments

func (*ClusterScope) ReconcileDRGVCNAttachment added in v0.3.0

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

ReconcileDRGVCNAttachment tries to attach the DRG to the VCN

func (*ClusterScope) ReconcileFailureDomains

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

func (*ClusterScope) ReconcileInternetGateway

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

ReconcileInternetGateway tries to move the Internet Gateway to the desired OCICluster Spec

func (*ClusterScope) ReconcileNSG

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

func (*ClusterScope) ReconcileNatGateway

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

ReconcileNatGateway tries to move the NAT Gateway to the desired OCICluster Spec

func (*ClusterScope) ReconcileRouteTable

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

func (*ClusterScope) ReconcileServiceGateway

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

func (*ClusterScope) ReconcileSubnet

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

func (*ClusterScope) ReconcileVCN

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

func (*ClusterScope) SetFailureDomain

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

SetFailureDomain sets the cluster's failure domain in the status

func (*ClusterScope) SetRegionKey added in v0.6.0

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

SetRegionKey sets the region key in the scope

func (*ClusterScope) UpdateDRGAttachment added in v0.3.0

func (s *ClusterScope) UpdateDRGAttachment(ctx context.Context) (*core.DrgAttachment, error)

func (*ClusterScope) UpdateLB

UpdateLB updates existing Load Balancer's DisplayName, FreeformTags and DefinedTags

func (*ClusterScope) UpdateNLB added in v0.9.0

UpdateLB updates existing Load Balancer's DisplayName, FreeformTags and DefinedTags

func (*ClusterScope) UpdateNSG

func (s *ClusterScope) UpdateNSG(ctx context.Context, nsgSpec infrastructurev1beta2.NSG) error

func (*ClusterScope) UpdateNSGSecurityRulesIfNeeded

func (s *ClusterScope) UpdateNSGSecurityRulesIfNeeded(ctx context.Context, desired infrastructurev1beta2.NSG,
	nsgId *string) (bool, error)

UpdateNSGSecurityRulesIfNeeded updates NSG rules if required by comparing actual and desired.

func (*ClusterScope) UpdateNatGateway

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

UpdateNatGateway updates the FreeFormTags and DefinedTags

func (*ClusterScope) UpdateSecurityList

func (s *ClusterScope) UpdateSecurityList(ctx context.Context, securityListSpec infrastructurev1beta2.SecurityList) error

func (*ClusterScope) UpdateSubnet

func (s *ClusterScope) UpdateSubnet(ctx context.Context, spec infrastructurev1beta2.Subnet) error

func (*ClusterScope) UpdateVCN

func (s *ClusterScope) UpdateVCN(ctx context.Context, vcn infrastructurev1beta2.VCN) error

func (*ClusterScope) VCNSpec

func (s *ClusterScope) VCNSpec() infrastructurev1beta2.VCN

type ClusterScopeClient

type ClusterScopeClient interface {
	ReconcileVCN(ctx context.Context) error
	ReconcileInternetGateway(ctx context.Context) error
	ReconcileNatGateway(ctx context.Context) error
	ReconcileServiceGateway(ctx context.Context) error
	ReconcileNSG(ctx context.Context) error
	ReconcileRouteTable(ctx context.Context) error
	ReconcileSubnet(ctx context.Context) error
	ReconcileApiServerNLB(ctx context.Context) error
	ReconcileApiServerLB(ctx context.Context) error
	ReconcileFailureDomains(ctx context.Context) error
	ReconcileDRG(ctx context.Context) error
	DeleteDRG(ctx context.Context) error
	ReconcileDRGVCNAttachment(ctx context.Context) error
	ReconcileDRGRPCAttachment(ctx context.Context) error
	DeleteApiServerNLB(ctx context.Context) error
	DeleteApiServerLB(ctx context.Context) error
	DeleteNSGs(ctx context.Context) error
	DeleteSubnets(ctx context.Context) error
	DeleteRouteTables(ctx context.Context) error
	DeleteSecurityLists(ctx context.Context) error
	DeleteServiceGateway(ctx context.Context) error
	DeleteNatGateway(ctx context.Context) error
	DeleteInternetGateway(ctx context.Context) error
	DeleteVCN(ctx context.Context) error
	DeleteDRGVCNAttachment(ctx context.Context) error
	DeleteDRGRPCAttachment(ctx context.Context) error
	GetOCIClusterAccessor() OCIClusterAccessor
	SetRegionKey(ctx context.Context) error
}

type ClusterScopeParams

type ClusterScopeParams struct {
	Client                    client.Client
	Logger                    *logr.Logger
	Cluster                   *clusterv1.Cluster
	VCNClient                 vcn.Client
	NetworkLoadBalancerClient nlb.NetworkLoadBalancerClient
	LoadBalancerClient        lb.LoadBalancerClient
	IdentityClient            identityClient.Client
	// RegionIdentifier Identifier as specified here https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm
	RegionIdentifier      string
	OCIAuthConfigProvider common.ConfigurationProvider
	ClientProvider        *ClientProvider
	OCIClusterAccessor    OCIClusterAccessor
	// RegionIdentifier Key as specified here https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm
	RegionKey string
}

ClusterScopeParams defines the params need to create a new ClusterScope

type MachinePoolScope added in v0.4.0

type MachinePoolScope struct {
	*logr.Logger
	Client client.Client

	Cluster                 *clusterv1.Cluster
	MachinePool             *expclusterv1.MachinePool
	ComputeManagementClient computemanagement.Client
	OCIClusterAccesor       OCIClusterAccessor
	OCIMachinePool          *expinfra1.OCIMachinePool
	// contains filtered or unexported fields
}

func NewMachinePoolScope added in v0.4.0

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

NewMachinePoolScope creates a MachinePoolScope given the MachinePoolScopeParams

func (*MachinePoolScope) BuildInstancePoolPlacement added in v0.4.0

func (s *MachinePoolScope) BuildInstancePoolPlacement() ([]core.CreateInstancePoolPlacementConfigurationDetails, error)

func (*MachinePoolScope) CleanupInstanceConfiguration added in v0.7.0

func (m *MachinePoolScope) CleanupInstanceConfiguration(ctx context.Context, instancePool *core.InstancePool) error

func (*MachinePoolScope) Close added in v0.4.0

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

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

func (*MachinePoolScope) CreateInstancePool added in v0.4.0

func (m *MachinePoolScope) CreateInstancePool(ctx context.Context) (*core.InstancePool, error)

CreateInstancePool attempts to create an instance pool

func (*MachinePoolScope) FindInstancePool added in v0.4.0

func (m *MachinePoolScope) FindInstancePool(ctx context.Context) (*core.InstancePool, error)

FindInstancePool attempts to find the instance pool by name and checks to make sure the instance pool was created by the cluster before returning the correct pool

func (*MachinePoolScope) GetBootstrapData added in v0.4.0

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

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

func (*MachinePoolScope) GetFreeFormTags added in v0.4.0

func (m *MachinePoolScope) GetFreeFormTags() map[string]string

GetFreeFormTags gets the free form tags for the MachinePoolScope cluster and returns them

func (*MachinePoolScope) GetInstanceConfiguration added in v0.7.0

func (m *MachinePoolScope) GetInstanceConfiguration(ctx context.Context) (*core.InstanceConfiguration, error)

GetInstanceConfiguration returns the instance configuration associated with the instance pool

func (*MachinePoolScope) GetInstanceConfigurationId added in v0.4.0

func (m *MachinePoolScope) GetInstanceConfigurationId() *string

GetInstanceConfigurationId returns the MachinePoolScope instance configuration id.

func (*MachinePoolScope) GetWorkerMachineNSG added in v0.4.0

func (m *MachinePoolScope) GetWorkerMachineNSG() *string

GetWorkerMachineNSG returns the worker role core.NetworkSecurityGroup id for the cluster

func (*MachinePoolScope) GetWorkerMachineSubnet added in v0.4.0

func (m *MachinePoolScope) GetWorkerMachineSubnet() *string

GetWorkerMachineSubnet returns the WorkerRole core.Subnet id for the cluster

func (*MachinePoolScope) HasFailed added in v0.4.0

func (m *MachinePoolScope) HasFailed() bool

HasFailed returns true when the OCIMachinePool's Failure reason or Failure message is populated.

func (*MachinePoolScope) IsResourceCreatedByClusterAPI added in v0.4.0

func (s *MachinePoolScope) IsResourceCreatedByClusterAPI(resourceFreeFormTags map[string]string) bool

IsResourceCreatedByClusterAPI determines if the instance was created by the cluster using the tags created at instance launch.

func (*MachinePoolScope) ListInstancePoolSummaries added in v0.4.0

func (m *MachinePoolScope) ListInstancePoolSummaries(ctx context.Context, req core.ListInstancePoolsRequest) ([]core.InstancePoolSummary, error)

ListInstancePoolSummaries list the core.InstancePoolSummary for the given core.ListInstancePoolsRequest

func (*MachinePoolScope) ListMachinePoolInstances added in v0.4.0

func (m *MachinePoolScope) ListMachinePoolInstances(ctx context.Context) ([]core.InstanceSummary, error)

ListMachinePoolInstances returns the list of instances belonging to an instance pool

func (*MachinePoolScope) PatchObject added in v0.4.0

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

PatchObject persists the cluster configuration and status.

func (*MachinePoolScope) ReconcileInstanceConfiguration added in v0.4.0

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

ReconcileInstanceConfiguration works to try to reconcile the state of the instance configuration for the cluster

func (*MachinePoolScope) SetFailureMessage added in v0.4.0

func (m *MachinePoolScope) SetFailureMessage(v error)

SetFailureMessage sets the OCIMachine status error message.

func (*MachinePoolScope) SetFailureReason added in v0.4.0

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

SetFailureReason sets the OCIMachine status error reason.

func (*MachinePoolScope) SetInstanceConfigurationIdStatus added in v0.4.0

func (m *MachinePoolScope) SetInstanceConfigurationIdStatus(id string)

SetInstanceConfigurationIdStatus sets the MachinePool InstanceConfigurationId status.

func (*MachinePoolScope) SetListandSetMachinePoolInstances added in v0.4.0

func (m *MachinePoolScope) SetListandSetMachinePoolInstances(ctx context.Context) ([]infrav2exp.OCIMachinePoolMachine, error)

SetListandSetMachinePoolInstances retrieves a machine pools instances and sets them in the ProviderIDList

func (*MachinePoolScope) SetReady added in v0.4.0

func (m *MachinePoolScope) SetReady()

SetReady sets the OCIMachine Ready Status.

func (*MachinePoolScope) SetReplicaCount added in v0.4.0

func (m *MachinePoolScope) SetReplicaCount(count int32)

func (*MachinePoolScope) TerminateInstancePool added in v0.4.0

func (m *MachinePoolScope) TerminateInstancePool(ctx context.Context, instancePool *core.InstancePool) error

func (*MachinePoolScope) UpdatePool added in v0.4.0

func (m *MachinePoolScope) UpdatePool(ctx context.Context, instancePool *core.InstancePool) (*core.InstancePool, error)

UpdatePool attempts to update the instance pool

type MachinePoolScopeParams added in v0.4.0

type MachinePoolScopeParams struct {
	Logger                  *logr.Logger
	Cluster                 *clusterv1.Cluster
	MachinePool             *expclusterv1.MachinePool
	Client                  client.Client
	ComputeManagementClient computemanagement.Client
	OCIClusterAccessor      OCIClusterAccessor
	OCIMachinePool          *expinfra1.OCIMachinePool
}

MachinePoolScopeParams defines the params need to create a new MachineScope

type MachineScope

type MachineScope struct {
	*logr.Logger
	Client client.Client

	Cluster                   *clusterv1.Cluster
	Machine                   *clusterv1.Machine
	ComputeClient             compute.ComputeClient
	OCIClusterAccessor        OCIClusterAccessor
	OCIMachine                *infrastructurev1beta2.OCIMachine
	VCNClient                 vcn.Client
	NetworkLoadBalancerClient nlb.NetworkLoadBalancerClient
	LoadBalancerClient        lb.LoadBalancerClient
	// contains filtered or unexported fields
}

func NewMachineScope

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

NewMachineScope creates a MachineScope given the MachineScopeParams

func (*MachineScope) Close

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

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

func (*MachineScope) DeleteMachine

func (m *MachineScope) DeleteMachine(ctx context.Context, instance *core.Instance) error

DeleteMachine terminates the instance using InstanceId from the OCIMachine spec and deletes the boot volume

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 OCIMachine instance id.

func (*MachineScope) GetInstanceIp

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

GetInstanceIp returns the OCIMachine's instance IP from its primary VNIC attachment.

See https://docs.oracle.com/en-us/iaas/Content/Network/Tasks/managingVNICs.htm for more on VNICs

func (*MachineScope) GetMachine

func (m *MachineScope) GetMachine(ctx context.Context) (*core.Instance, error)

GetMachine will attempt to get the machine instance by instance id, or display name if not instance id

func (*MachineScope) GetMachineByDisplayName

func (m *MachineScope) GetMachineByDisplayName(ctx context.Context, name string) (*core.Instance, error)

GetMachineByDisplayName returns the machine from the compartment if there is a matching DisplayName, and it was created by the cluster

func (*MachineScope) GetMachineIPFromStatus

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

GetMachineIPFromStatus returns the IP address from the OCIMachine's status if it is the Internal IP

func (*MachineScope) GetOrCreateMachine

func (m *MachineScope) GetOrCreateMachine(ctx context.Context) (*core.Instance, error)

GetOrCreateMachine will get machine instance or create if the instances doesn't exist

func (*MachineScope) IsControlPlane

func (m *MachineScope) IsControlPlane() bool

IsControlPlane returns true if the machine is a control plane.

func (*MachineScope) IsReady

func (m *MachineScope) IsReady() bool

IsReady returns the ready status of the machine.

func (*MachineScope) IsResourceCreatedByClusterAPI

func (m *MachineScope) IsResourceCreatedByClusterAPI(resourceFreeFormTags map[string]string) bool

IsResourceCreatedByClusterAPI determines if the instance was created by the cluster using the tags created at instance launch.

func (*MachineScope) Name

func (m *MachineScope) Name() string

Name returns the OCIMachine name.

func (*MachineScope) PatchObject

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

PatchObject persists the cluster configuration and status.

func (*MachineScope) ReconcileCreateInstanceOnLB

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

ReconcileCreateInstanceOnLB sets up backend sets for the load balancer

func (*MachineScope) ReconcileDeleteInstanceOnLB

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

ReconcileDeleteInstanceOnLB checks to make sure the instance is part of a backend set then deletes the backend on the NetworkLoadBalancer

It will await the Work Request completion before returning

See https://docs.oracle.com/en-us/iaas/Content/NetworkLoadBalancer/BackendServers/backend_server_management.htm#BackendServerManagement for more info on Backend Server Management

func (*MachineScope) ReconcileVnicAttachments added in v0.7.0

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

func (*MachineScope) SetFailureMessage

func (m *MachineScope) SetFailureMessage(v error)

SetFailureMessage sets the OCIMachine status error message.

func (*MachineScope) SetFailureReason

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

SetFailureReason sets the OCIMachine status error reason.

func (*MachineScope) SetNotReady added in v0.11.3

func (m *MachineScope) SetNotReady()

SetNotReady sets the OCIMachine Ready Status to false.

func (*MachineScope) SetReady

func (m *MachineScope) SetReady()

SetReady sets the OCIMachine Ready Status.

type MachineScopeParams

type MachineScopeParams struct {
	Logger                    *logr.Logger
	Cluster                   *clusterv1.Cluster
	Machine                   *clusterv1.Machine
	Client                    client.Client
	ComputeClient             compute.ComputeClient
	OCIClusterAccessor        OCIClusterAccessor
	OCIMachine                *infrastructurev1beta2.OCIMachine
	VCNClient                 vcn.Client
	NetworkLoadBalancerClient nlb.NetworkLoadBalancerClient
	LoadBalancerClient        lb.LoadBalancerClient
}

MachineScopeParams defines the params need to create a new MachineScope

type ManagedControlPlaneScope added in v0.6.0

type ManagedControlPlaneScope struct {
	*logr.Logger

	Cluster                *clusterv1.Cluster
	ContainerEngineClient  containerengine.Client
	BaseClient             baseclient.BaseClient
	ClientProvider         *ClientProvider
	OCIManagedControlPlane *infrastructurev1beta2.OCIManagedControlPlane
	OCIClusterAccessor     OCIClusterAccessor
	RegionIdentifier       string
	// contains filtered or unexported fields
}

func NewManagedControlPlaneScope added in v0.6.0

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

NewManagedControlPlaneScope creates a ManagedControlPlaneScope given the ManagedControlPlaneScopeParams

func (*ManagedControlPlaneScope) DeleteOKECluster added in v0.6.0

func (s *ManagedControlPlaneScope) DeleteOKECluster(ctx context.Context, cluster *oke.Cluster) error

DeleteOKECluster deletes an OKE cluster

func (*ManagedControlPlaneScope) GetClusterName added in v0.6.0

func (s *ManagedControlPlaneScope) GetClusterName() string

GetClusterName returns the name of the cluster

func (*ManagedControlPlaneScope) GetOKECluster added in v0.6.0

func (s *ManagedControlPlaneScope) GetOKECluster(ctx context.Context) (*oke.Cluster, error)

GetOKECluster tries to lookup a control plane(OKE cluster) based on ID/Name and returns the cluster if it exists,

func (*ManagedControlPlaneScope) GetOrCreateControlPlane added in v0.6.0

func (s *ManagedControlPlaneScope) GetOrCreateControlPlane(ctx context.Context) (*oke.Cluster, error)

GetOrCreateControlPlane tries to lookup a control plane(OKE cluster) based on ID/Name and returns the cluster if it exists, else creates an OKE cluster with the provided parameters in spec.

func (*ManagedControlPlaneScope) IsControlPlaneEndpointSubnetPublic added in v0.6.0

func (s *ManagedControlPlaneScope) IsControlPlaneEndpointSubnetPublic() bool

IsControlPlaneEndpointSubnetPublic returns true if the control plane endpoint subnet is public

func (*ManagedControlPlaneScope) ReconcileAddons added in v0.11.0

func (s *ManagedControlPlaneScope) ReconcileAddons(ctx context.Context, okeCluster *oke.Cluster) error

ReconcileAddons reconciles addons which have been specified in the spec on the OKE cluster

func (*ManagedControlPlaneScope) ReconcileBootstrapSecret added in v0.12.0

func (s *ManagedControlPlaneScope) ReconcileBootstrapSecret(ctx context.Context, okeCluster *oke.Cluster) error

ReconcileBootstrapSecret reconciles the bootsrap secret which will be used by self managed nodes

func (*ManagedControlPlaneScope) ReconcileKubeconfig added in v0.6.0

func (s *ManagedControlPlaneScope) ReconcileKubeconfig(ctx context.Context, okeCluster *oke.Cluster) error

ReconcileKubeconfig reconciles the kubeconfig secret which will be used by core CAPI components to talk to the OKE cluster

func (*ManagedControlPlaneScope) UpdateControlPlane added in v0.6.0

func (s *ManagedControlPlaneScope) UpdateControlPlane(ctx context.Context, okeCluster *oke.Cluster) (bool, error)

UpdateControlPlane updates the control plane(OKE cluster) if necessary based on spec changes

type ManagedControlPlaneScopeParams added in v0.6.0

type ManagedControlPlaneScopeParams struct {
	Logger                 *logr.Logger
	Client                 client.Client
	Cluster                *clusterv1.Cluster
	ContainerEngineClient  containerengine.Client
	BaseClient             baseclient.BaseClient
	ClientProvider         *ClientProvider
	OCIManagedControlPlane *infrastructurev1beta2.OCIManagedControlPlane
	OCIClusterAccessor     OCIClusterAccessor
	RegionIdentifier       string
}

ManagedControlPlaneScopeParams defines the params need to create a new ManagedControlPlaneScope

type ManagedMachinePoolScope added in v0.6.0

type ManagedMachinePoolScope struct {
	*logr.Logger
	Client client.Client

	Cluster                 *clusterv1.Cluster
	MachinePool             *expclusterv1.MachinePool
	ComputeManagementClient computemanagement.Client
	OCIManagedCluster       *infrastructurev1beta2.OCIManagedCluster
	OCIManagedMachinePool   *expinfra1.OCIManagedMachinePool
	ContainerEngineClient   containerengine.Client
	OCIManagedControlPlane  *infrastructurev1beta2.OCIManagedControlPlane
	// contains filtered or unexported fields
}

func NewManagedMachinePoolScope added in v0.6.0

func NewManagedMachinePoolScope(params ManagedMachinePoolScopeParams) (*ManagedMachinePoolScope, error)

NewManagedMachinePoolScope creates a ManagedMachinePoolScope given the ManagedMachinePoolScopeParams

func (*ManagedMachinePoolScope) Close added in v0.6.0

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

func (*ManagedMachinePoolScope) CreateNodePool added in v0.6.0

func (m *ManagedMachinePoolScope) CreateNodePool(ctx context.Context) (*oke.NodePool, error)

CreateNodePool attempts to create a node pool

func (*ManagedMachinePoolScope) DeleteNodePool added in v0.6.0

func (m *ManagedMachinePoolScope) DeleteNodePool(ctx context.Context, nodePool *oke.NodePool) error

DeleteNodePool terminates a nodepool

func (*ManagedMachinePoolScope) FindNodePool added in v0.6.0

func (m *ManagedMachinePoolScope) FindNodePool(ctx context.Context) (*oke.NodePool, error)

FindNodePool attempts to find the node pool by id if the id exists or by name. It checks to make sure the node pool was created by the cluster before returning the correct pool

func (*ManagedMachinePoolScope) GetWorkerMachineSubnet added in v0.6.0

func (m *ManagedMachinePoolScope) GetWorkerMachineSubnet() *string

GetWorkerMachineSubnet returns the WorkerRole core.Subnet id for the cluster

func (*ManagedMachinePoolScope) IsResourceCreatedByClusterAPI added in v0.6.0

func (m *ManagedMachinePoolScope) IsResourceCreatedByClusterAPI(resourceFreeFormTags map[string]string) bool

IsResourceCreatedByClusterAPI determines if the instance was created by the cluster using the tags created at instance launch.

func (*ManagedMachinePoolScope) PatchObject added in v0.6.0

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

PatchObject persists the cluster configuration and status.

func (*ManagedMachinePoolScope) SetFailureReason added in v0.6.0

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

SetFailureReason sets the OCIMachine status error reason.

func (*ManagedMachinePoolScope) SetListandSetMachinePoolInstances added in v0.6.0

func (m *ManagedMachinePoolScope) SetListandSetMachinePoolInstances(ctx context.Context, nodePool *oke.NodePool) (int32, error)

SetListandSetMachinePoolInstances retrieves a machine pools instances and sets them in the ProviderIDList

func (*ManagedMachinePoolScope) SetReplicaCount added in v0.6.0

func (m *ManagedMachinePoolScope) SetReplicaCount(count int32)

func (*ManagedMachinePoolScope) UpdateNodePool added in v0.6.0

func (m *ManagedMachinePoolScope) UpdateNodePool(ctx context.Context, pool *oke.NodePool) (bool, error)

UpdateNodePool updates a node pool, if needed, based on updated spec

type ManagedMachinePoolScopeParams added in v0.6.0

type ManagedMachinePoolScopeParams struct {
	Logger                  *logr.Logger
	Cluster                 *clusterv1.Cluster
	MachinePool             *expclusterv1.MachinePool
	Client                  client.Client
	ComputeManagementClient computemanagement.Client
	OCIManagedCluster       *infrastructurev1beta2.OCIManagedCluster
	OCIManagedControlPlane  *infrastructurev1beta2.OCIManagedControlPlane
	OCIManagedMachinePool   *expinfra1.OCIManagedMachinePool
	ContainerEngineClient   containerengine.Client
}

ManagedMachinePoolScopeParams defines the params need to create a new ManagedMachinePoolScope

type MockOCIClients added in v0.2.0

type MockOCIClients struct {
	VCNClient                 vcn.Client
	ComputeClient             compute.ComputeClient
	NetworkLoadBalancerClient *networkloadbalancer.NetworkLoadBalancerClient
	LoadBalancerClient        *loadbalancer.LoadBalancerClient
	IdentityClient            identity.Client
}

type OCIClients added in v0.2.0

type OCIClients struct {
	ComputeClient             compute.ComputeClient
	ComputeManagementClient   computemanagement.Client
	VCNClient                 vcn.Client
	NetworkLoadBalancerClient nlb.NetworkLoadBalancerClient
	LoadBalancerClient        lb.LoadBalancerClient
	IdentityClient            identityClient.Client
	ContainerEngineClient     containerEngineClient.Client
	BaseClient                base.BaseClient
}

OCIClients is the struct of all the needed OCI clients

type OCIClusterAccessor added in v0.6.0

type OCIClusterAccessor interface {
	// GetOCIResourceIdentifier returns the OCI resource identifier of the cluster.
	GetOCIResourceIdentifier() string
	// GetDefinedTags returns the defined tags of the cluster.
	GetDefinedTags() map[string]map[string]string
	// GetCompartmentId returns the compartment id of the cluster.
	GetCompartmentId() string
	// GetFreeformTags returns the free form tags of the cluster.
	GetFreeformTags() map[string]string
	// GetName returns the name of the cluster.
	GetName() string
	// GetNameSpace returns the namespace of the cluster.
	GetNameSpace() string
	// GetRegion returns the region of the cluster, if specified in the spec.
	GetRegion() string
	// GetClientOverrides returns the client host url overrides for the cluster
	GetClientOverrides() *infrastructurev1beta2.ClientOverrides
	// GetNetworkSpec returns the NetworkSpec of the cluster.
	GetNetworkSpec() *infrastructurev1beta2.NetworkSpec
	// GetControlPlaneEndpoint returns the control plane endpoint of the cluster.
	GetControlPlaneEndpoint() clusterv1.APIEndpoint
	// SetControlPlaneEndpoint sets the control plane endpoint of the cluster.
	SetControlPlaneEndpoint(endpoint clusterv1.APIEndpoint)
	// GetFailureDomains returns the failure domains of the cluster.
	GetFailureDomains() clusterv1.FailureDomains
	// SetFailureDomain sets the failure domain.
	SetFailureDomain(id string, spec clusterv1.FailureDomainSpec)
	// GetAvailabilityDomains get the availability domain.
	GetAvailabilityDomains() map[string]infrastructurev1beta2.OCIAvailabilityDomain
	// SetAvailabilityDomains sets the availability domain.
	SetAvailabilityDomains(ads map[string]infrastructurev1beta2.OCIAvailabilityDomain)
	// MarkConditionFalse marks the provided condition as false in the cluster object
	MarkConditionFalse(t clusterv1.ConditionType, reason string, severity clusterv1.ConditionSeverity, messageFormat string, messageArgs ...interface{})
	// GetIdentityRef returns the Identity reference of the cluster
	GetIdentityRef() *corev1.ObjectReference
	// GetProviderID returns the provider id for the instance
	GetProviderID(instanceId string) string
}

OCIClusterAccessor interface defines the methods needed to access or modify member variables in Cluster object. This interface is required because there are 2 different cluster objects in OCI provider, OCiCluster(which is self managed) and OCIManagedCluster(which is a managed cluster - OKE). But both these clusters needs to share the same code for Network reconciliation. Hence this wrapper interface,

type OCIManagedCluster added in v0.6.0

type OCIManagedCluster struct {
	OCIManagedCluster *infrastructurev1beta2.OCIManagedCluster
}

OCIManagedCluster is the ClusterAccessor implementation for managed clusters(OKE)

func (OCIManagedCluster) GetAvailabilityDomains added in v0.9.0

func (OCIManagedCluster) GetClientOverrides added in v0.9.0

func (OCIManagedCluster) GetCompartmentId added in v0.6.0

func (c OCIManagedCluster) GetCompartmentId() string

func (OCIManagedCluster) GetControlPlaneEndpoint added in v0.12.0

func (c OCIManagedCluster) GetControlPlaneEndpoint() clusterv1.APIEndpoint

func (OCIManagedCluster) GetDRG added in v0.6.0

func (OCIManagedCluster) GetDefinedTags added in v0.6.0

func (c OCIManagedCluster) GetDefinedTags() map[string]map[string]string

func (OCIManagedCluster) GetFailureDomains added in v0.6.0

func (c OCIManagedCluster) GetFailureDomains() clusterv1.FailureDomains

func (OCIManagedCluster) GetFreeformTags added in v0.6.0

func (c OCIManagedCluster) GetFreeformTags() map[string]string

func (OCIManagedCluster) GetIdentityRef added in v0.7.0

func (c OCIManagedCluster) GetIdentityRef() *corev1.ObjectReference

func (OCIManagedCluster) GetName added in v0.6.0

func (c OCIManagedCluster) GetName() string

func (OCIManagedCluster) GetNameSpace added in v0.7.0

func (c OCIManagedCluster) GetNameSpace() string

func (OCIManagedCluster) GetNetworkSpec added in v0.6.0

func (OCIManagedCluster) GetOCIResourceIdentifier added in v0.6.0

func (c OCIManagedCluster) GetOCIResourceIdentifier() string

func (OCIManagedCluster) GetProviderID added in v0.12.0

func (c OCIManagedCluster) GetProviderID(instanceId string) string

func (OCIManagedCluster) GetRegion added in v0.7.0

func (c OCIManagedCluster) GetRegion() string

func (OCIManagedCluster) GetVCNPeering added in v0.6.0

func (OCIManagedCluster) MarkConditionFalse added in v0.7.0

func (c OCIManagedCluster) MarkConditionFalse(t clusterv1.ConditionType, reason string, severity clusterv1.ConditionSeverity, messageFormat string, messageArgs ...interface{})

func (OCIManagedCluster) SetAvailabilityDomains added in v0.6.0

func (c OCIManagedCluster) SetAvailabilityDomains(ads map[string]infrastructurev1beta2.OCIAvailabilityDomain)

func (OCIManagedCluster) SetControlPlaneEndpoint added in v0.6.0

func (c OCIManagedCluster) SetControlPlaneEndpoint(endpoint clusterv1.APIEndpoint)

func (OCIManagedCluster) SetFailureDomain added in v0.6.0

func (c OCIManagedCluster) SetFailureDomain(id string, spec clusterv1.FailureDomainSpec)

type OCISelfManagedCluster added in v0.6.0

type OCISelfManagedCluster struct {
	OCICluster *infrastructurev1beta2.OCICluster
}

OCISelfManagedCluster is the ClusterAccessor implementation for self managed clusters

func (OCISelfManagedCluster) GetAvailabilityDomains added in v0.9.0

func (OCISelfManagedCluster) GetClientOverrides added in v0.9.0

func (OCISelfManagedCluster) GetCompartmentId added in v0.6.0

func (c OCISelfManagedCluster) GetCompartmentId() string

func (OCISelfManagedCluster) GetControlPlaneEndpoint added in v0.12.0

func (c OCISelfManagedCluster) GetControlPlaneEndpoint() clusterv1.APIEndpoint

func (OCISelfManagedCluster) GetDRG added in v0.6.0

func (OCISelfManagedCluster) GetDefinedTags added in v0.6.0

func (c OCISelfManagedCluster) GetDefinedTags() map[string]map[string]string

func (OCISelfManagedCluster) GetFailureDomains added in v0.6.0

func (c OCISelfManagedCluster) GetFailureDomains() clusterv1.FailureDomains

func (OCISelfManagedCluster) GetFreeformTags added in v0.6.0

func (c OCISelfManagedCluster) GetFreeformTags() map[string]string

func (OCISelfManagedCluster) GetIdentityRef added in v0.7.0

func (c OCISelfManagedCluster) GetIdentityRef() *corev1.ObjectReference

func (OCISelfManagedCluster) GetName added in v0.6.0

func (c OCISelfManagedCluster) GetName() string

func (OCISelfManagedCluster) GetNameSpace added in v0.7.0

func (c OCISelfManagedCluster) GetNameSpace() string

func (OCISelfManagedCluster) GetNetworkSpec added in v0.6.0

func (OCISelfManagedCluster) GetOCIResourceIdentifier added in v0.6.0

func (c OCISelfManagedCluster) GetOCIResourceIdentifier() string

func (OCISelfManagedCluster) GetProviderID added in v0.12.0

func (c OCISelfManagedCluster) GetProviderID(instanceId string) string

func (OCISelfManagedCluster) GetRegion added in v0.7.0

func (c OCISelfManagedCluster) GetRegion() string

func (OCISelfManagedCluster) GetVCNPeering added in v0.6.0

func (OCISelfManagedCluster) MarkConditionFalse added in v0.7.0

func (c OCISelfManagedCluster) MarkConditionFalse(t clusterv1.ConditionType, reason string, severity clusterv1.ConditionSeverity, messageFormat string, messageArgs ...interface{})

func (OCISelfManagedCluster) SetAvailabilityDomains added in v0.6.0

func (c OCISelfManagedCluster) SetAvailabilityDomains(ads map[string]infrastructurev1beta2.OCIAvailabilityDomain)

func (OCISelfManagedCluster) SetControlPlaneEndpoint added in v0.6.0

func (c OCISelfManagedCluster) SetControlPlaneEndpoint(endpoint clusterv1.APIEndpoint)

func (OCISelfManagedCluster) SetFailureDomain added in v0.6.0

func (c OCISelfManagedCluster) SetFailureDomain(id string, spec clusterv1.FailureDomainSpec)

type VirtualMachinePoolScope added in v0.10.0

type VirtualMachinePoolScope struct {
	*logr.Logger
	Client client.Client

	Cluster                 *clusterv1.Cluster
	MachinePool             *expclusterv1.MachinePool
	ComputeManagementClient computemanagement.Client
	OCIManagedCluster       *infrastructurev1beta2.OCIManagedCluster
	OCIVirtualMachinePool   *expinfra1.OCIVirtualMachinePool
	ContainerEngineClient   containerengine.Client
	OCIManagedControlPlane  *infrastructurev1beta2.OCIManagedControlPlane
	// contains filtered or unexported fields
}

func NewVirtualMachinePoolScope added in v0.10.0

func NewVirtualMachinePoolScope(params VirtualMachinePoolScopeParams) (*VirtualMachinePoolScope, error)

NewVirtualMachinePoolScope creates a VirtualMachinePoolScope given the VirtualMachinePoolScopeParams

func (*VirtualMachinePoolScope) Close added in v0.10.0

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

func (*VirtualMachinePoolScope) CreateVirtualNodePool added in v0.10.0

func (m *VirtualMachinePoolScope) CreateVirtualNodePool(ctx context.Context) (*oke.VirtualNodePool, error)

CreateVirtualNodePool attempts to create a virtual node pool

func (*VirtualMachinePoolScope) DeleteVirtualNodePool added in v0.10.0

func (m *VirtualMachinePoolScope) DeleteVirtualNodePool(ctx context.Context, nodePool *oke.VirtualNodePool) error

DeleteVirtualNodePool terminates a virtual nodepool

func (*VirtualMachinePoolScope) FindVirtualNodePool added in v0.10.0

func (m *VirtualMachinePoolScope) FindVirtualNodePool(ctx context.Context) (*oke.VirtualNodePool, error)

FindVirtualNodePool attempts to find the node pool by id if the id exists or by name. It checks to make sure the node pool was created by the cluster before returning the correct pool

func (*VirtualMachinePoolScope) GetWorkerMachineSubnet added in v0.10.0

func (m *VirtualMachinePoolScope) GetWorkerMachineSubnet() *string

GetWorkerMachineSubnet returns the WorkerRole core.Subnet id for the cluster

func (*VirtualMachinePoolScope) IsResourceCreatedByClusterAPI added in v0.10.0

func (m *VirtualMachinePoolScope) IsResourceCreatedByClusterAPI(resourceFreeFormTags map[string]string) bool

IsResourceCreatedByClusterAPI determines if the virtual node pool was created by the cluster using the tags created at virtual node pool launch.

func (*VirtualMachinePoolScope) ListandSetMachinePoolInstances added in v0.10.0

func (m *VirtualMachinePoolScope) ListandSetMachinePoolInstances(ctx context.Context, nodePool *oke.VirtualNodePool) ([]infrav2exp.OCIMachinePoolMachine, error)

ListandSetMachinePoolInstances retrieves a virtual node pools instances and sets them in the ProviderIDList

func (*VirtualMachinePoolScope) PatchObject added in v0.10.0

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

PatchObject persists the cluster configuration and status.

func (*VirtualMachinePoolScope) SetFailureReason added in v0.10.0

SetFailureReason sets the OCIMachine status error reason.

func (*VirtualMachinePoolScope) SetReplicaCount added in v0.10.0

func (m *VirtualMachinePoolScope) SetReplicaCount(count int32)

func (*VirtualMachinePoolScope) UpdateVirtualNodePool added in v0.10.0

func (m *VirtualMachinePoolScope) UpdateVirtualNodePool(ctx context.Context, pool *oke.VirtualNodePool) (bool, error)

UpdateVirtualNodePool updates a virtual node pool, if needed, based on updated spec

type VirtualMachinePoolScopeParams added in v0.10.0

type VirtualMachinePoolScopeParams struct {
	Logger                  *logr.Logger
	Cluster                 *clusterv1.Cluster
	MachinePool             *expclusterv1.MachinePool
	Client                  client.Client
	ComputeManagementClient computemanagement.Client
	OCIManagedCluster       *infrastructurev1beta2.OCIManagedCluster
	OCIManagedControlPlane  *infrastructurev1beta2.OCIManagedControlPlane
	OCIVirtualMachinePool   *expinfra1.OCIVirtualMachinePool
	ContainerEngineClient   containerengine.Client
}

VirtualMachinePoolScopeParams defines the params need to create a new VirtualMachinePoolScope

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