providerconfig

package
v0.0.0-...-2b86969 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFailureDomainFromMachine

func ExtractFailureDomainFromMachine(logger logr.Logger, machine machinev1beta1.Machine, infrastructure *configv1.Infrastructure) (failuredomain.FailureDomain, error)

ExtractFailureDomainFromMachine FailureDomain extracted from the provided machine.

func ExtractFailureDomainsFromMachineSets

func ExtractFailureDomainsFromMachineSets(logger logr.Logger, machineSets []machinev1beta1.MachineSet, infrastructure *configv1.Infrastructure) ([]failuredomain.FailureDomain, error)

ExtractFailureDomainsFromMachineSets creates list of FailureDomains extracted from the provided list of machineSets.

func ExtractFailureDomainsFromMachines

func ExtractFailureDomainsFromMachines(logger logr.Logger, machines []machinev1beta1.Machine, infrastructure *configv1.Infrastructure) ([]failuredomain.FailureDomain, error)

ExtractFailureDomainsFromMachines creates list of FailureDomains extracted from the provided list of machines.

Types

type AWSProviderConfig

type AWSProviderConfig struct {
	// contains filtered or unexported fields
}

AWSProviderConfig holds the provider spec of an AWS Machine. It allows external code to extract and inject failure domain information, as well as gathering the stored config.

func (AWSProviderConfig) Config

Config returns the stored AWSMachineProviderConfig.

func (AWSProviderConfig) ExtractFailureDomain

func (a AWSProviderConfig) ExtractFailureDomain() machinev1.AWSFailureDomain

ExtractFailureDomain returns an AWSFailureDomain based on the failure domain information stored within the AWSProviderConfig.

func (AWSProviderConfig) InjectFailureDomain

InjectFailureDomain returns a new AWSProviderConfig configured with the failure domain information provided.

type AzureProviderConfig

type AzureProviderConfig struct {
	// contains filtered or unexported fields
}

AzureProviderConfig holds the provider spec of an Azure Machine. It allows external code to extract and inject failure domain information, as well as gathering the stored config.

func (AzureProviderConfig) Config

Config returns the stored AzureMachineProviderSpec.

func (AzureProviderConfig) ExtractFailureDomain

func (a AzureProviderConfig) ExtractFailureDomain() machinev1.AzureFailureDomain

ExtractFailureDomain returns an AzureFailureDomain based on the failure domain information stored within the AzureProviderConfig.

func (AzureProviderConfig) InjectFailureDomain

InjectFailureDomain returns a new AzureProviderConfig configured with the failure domain information provided.

type GCPProviderConfig

type GCPProviderConfig struct {
	// contains filtered or unexported fields
}

GCPProviderConfig holds the provider spec of a GCP Machine. It allows external code to extract and inject failure domain information, as well as gathering the stored config.

func (GCPProviderConfig) Config

Config returns the stored GCPMachineProviderSpec.

func (GCPProviderConfig) ExtractFailureDomain

func (g GCPProviderConfig) ExtractFailureDomain() machinev1.GCPFailureDomain

ExtractFailureDomain returns a GCPFailureDomain based on the failure domain information stored within the GCPProviderConfig.

func (GCPProviderConfig) InjectFailureDomain

InjectFailureDomain returns a new GCPProviderConfig configured with the failure domain.

type GenericProviderConfig

type GenericProviderConfig struct {
	// contains filtered or unexported fields
}

GenericProviderConfig holds the provider spec for machine on platforms that don't support failure domains and can be handled generically.

func (GenericProviderConfig) ExtractFailureDomain

func (g GenericProviderConfig) ExtractFailureDomain() failuredomain.FailureDomain

ExtractFailureDomain extract generic failure domain that contains just the platform type.

type NutanixProviderConfig

type NutanixProviderConfig struct {
	// contains filtered or unexported fields
}

NutanixProviderConfig is a wrapper around machinev1.NutanixMachineProviderConfig.

func (NutanixProviderConfig) Config

Config returns the stored NutanixMachineProviderConfig.

func (NutanixProviderConfig) ExtractFailureDomain

ExtractFailureDomain is used to extract a failure domain from the ProviderConfig.

func (NutanixProviderConfig) GetFailureDomainByName

func (n NutanixProviderConfig) GetFailureDomainByName(failureDomainName string) (*configv1.NutanixFailureDomain, error)

GetFailureDomainByName returns the NutanixFailureDomain if the input name referenced failureDomain is configured in the Infrastructure resource.

func (NutanixProviderConfig) Infrastructure

func (n NutanixProviderConfig) Infrastructure() *configv1.Infrastructure

Infrastructure returns the stored *configv1.Infrastructure.

func (NutanixProviderConfig) InjectFailureDomain

InjectFailureDomain returns a new NutanixProviderConfig configured with the failure domain information provided.

func (NutanixProviderConfig) ResetFailureDomainRelatedFields

func (n NutanixProviderConfig) ResetFailureDomainRelatedFields() ProviderConfig

ResetFailureDomainRelatedFields resets fields related to failure domain.

type OpenStackProviderConfig

type OpenStackProviderConfig struct {
	// contains filtered or unexported fields
}

OpenStackProviderConfig holds the provider spec of an OpenStack Machine. It allows external code to extract and inject failure domain information, as well as gathering the stored config.

func (OpenStackProviderConfig) Config

Config returns the stored OpenStackMachineProviderSpec.

func (OpenStackProviderConfig) ExtractFailureDomain

func (a OpenStackProviderConfig) ExtractFailureDomain() machinev1.OpenStackFailureDomain

ExtractFailureDomain returns an OpenStackFailureDomain based on the failure domain information stored within the OpenStackProviderConfig.

func (OpenStackProviderConfig) InjectFailureDomain

InjectFailureDomain returns a new OpenStackProviderConfig configured with the failure domain information provided.

type ProviderConfig

type ProviderConfig interface {
	// InjectFailureDomain is used to inject a failure domain into the ProviderConfig.
	// The returned ProviderConfig will be a copy of the current ProviderConfig with
	// the new failure domain injected.
	InjectFailureDomain(failuredomain.FailureDomain) (ProviderConfig, error)

	// ExtractFailureDomain is used to extract a failure domain from the ProviderConfig.
	ExtractFailureDomain() failuredomain.FailureDomain

	// Equal compares two ProviderConfigs to determine whether or not they are equal.
	Equal(ProviderConfig) (bool, error)

	// Diff compares two ProviderConfigs and returns a list of differences,
	// or nil if there are none.
	Diff(ProviderConfig) ([]string, error)

	// RawConfig marshalls the configuration into a JSON byte slice.
	RawConfig() ([]byte, error)

	// Type returns the platform type of the provider config.
	Type() configv1.PlatformType

	// AWS returns the AWSProviderConfig if the platform type is AWS.
	AWS() AWSProviderConfig

	// Azure returns the AzureProviderConfig if the platform type is Azure.
	Azure() AzureProviderConfig

	// GCP returns the GCPProviderConfig if the platform type is GCP.
	GCP() GCPProviderConfig

	// Nutanix returns the NutanixProviderConfig if the platform type is Nutanix.
	Nutanix() NutanixProviderConfig

	// OpenStack returns the OpenStackProviderConfig if the platform type is OpenStack.
	OpenStack() OpenStackProviderConfig

	// VSphere returns the VSphereProviderConfig if the platform type is VSphere.
	VSphere() VSphereProviderConfig

	// Generic returns the GenericProviderConfig if we are on a platform that is using generic provider abstraction.
	Generic() GenericProviderConfig
}

ProviderConfig is an interface that allows external code to interact with provider configuration across different platform types.

func NewProviderConfigFromMachineSpec

func NewProviderConfigFromMachineSpec(logger logr.Logger, machineSpec machinev1beta1.MachineSpec, infrastructure *configv1.Infrastructure) (ProviderConfig, error)

NewProviderConfigFromMachineSpec creates a new ProviderConfig from the provided machineSpec object.

func NewProviderConfigFromMachineTemplate

func NewProviderConfigFromMachineTemplate(logger logr.Logger, tmpl machinev1.OpenShiftMachineV1Beta1MachineTemplate, infrastructure *configv1.Infrastructure) (ProviderConfig, error)

NewProviderConfigFromMachineTemplate creates a new ProviderConfig from the provided machine template.

type VSphereProviderConfig

type VSphereProviderConfig struct {
	// contains filtered or unexported fields
}

VSphereProviderConfig holds the provider spec of a VSphere Machine. It allows external code to extract and inject failure domain information, as well as gathering the stored config.

func (VSphereProviderConfig) Config

Config returns the stored VSphereMachineProviderSpec.

func (VSphereProviderConfig) Diff

Diff compares two ProviderConfigs and returns a list of differences, or nil if there are none.

func (VSphereProviderConfig) ExtractFailureDomain

func (v VSphereProviderConfig) ExtractFailureDomain() machinev1.VSphereFailureDomain

ExtractFailureDomain is used to extract a failure domain from the ProviderConfig.

func (VSphereProviderConfig) InjectFailureDomain

InjectFailureDomain returns a new VSphereProviderConfig configured with the failure domain.

func (VSphereProviderConfig) ResetTopologyRelatedFields

func (v VSphereProviderConfig) ResetTopologyRelatedFields() ProviderConfig

ResetTopologyRelatedFields resets fields related to topology and VM placement such as the workspace, network, and template.

Jump to

Keyboard shortcuts

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