Documentation ¶
Index ¶
- Constants
- func GetCloudEnvironment(infra *configv1.Infrastructure) (string, string)
- func GetInfrastructure(client controllerclient.Client) (*configv1.Infrastructure, error)
- func MachineConfigFromProviderSpec(providerConfig machinev1.ProviderSpec) (*machinev1.AzureMachineProviderSpec, error)
- func ProviderStatusFromRawExtension(extension *runtime.RawExtension) (*machinev1.AzureMachineProviderStatus, error)
- func RawExtensionFromProviderSpec(spec *machinev1.AzureMachineProviderSpec) (*runtime.RawExtension, error)
- func RawExtensionFromProviderStatus(status *machinev1.AzureMachineProviderStatus) (*runtime.RawExtension, error)
- type AzureClients
- type MachineScope
- type MachineScopeGetter
- type MachineScopeGetterFunc
- type MachineScopeParams
Constants ¶
const ( // AzureCredsSubscriptionIDKey subcription ID AzureCredsSubscriptionIDKey = "azure_subscription_id" // AzureCredsClientIDKey client ID AzureCredsClientIDKey = "azure_client_id" // AzureCredsClientSecretKey client secret AzureCredsClientSecretKey = "azure_client_secret" // AzureCredsTenantIDKey tenant ID AzureCredsTenantIDKey = "azure_tenant_id" // AzureCredsResourceGroupKey resource group AzureCredsResourceGroupKey = "azure_resourcegroup" // AzureCredsRegionKey region AzureCredsRegionKey = "azure_region" // AzureResourcePrefix resource prefix for created azure resources AzureResourcePrefix = "azure_resource_prefix" // AzureFederatedTokenFileKey path for federated identity token AzureFederatedTokenFileKey = "azure_federated_token_file" // AzureCredsTenantIDEnvironmentVar tenant ID (environment variable) AzureCredsTenantIDEnvironmentVar = "AZURE_TENANT_ID" // AzureCredsClientIDEnvironmentVar client ID (environment variable) AzureCredsClientIDEnvironmentVar = "AZURE_CLIENT_ID" // AzureCredsClientSecretEnvironmentVar client secret (environment variable) AzureCredsClientSecretEnvironmentVar = "AZURE_CLIENT_SECRET" // AzureFederatedTokenFileEnvironmentVar path for federated identity token (environment variable) AzureFederatedTokenFileEnvironmentVar = "AZURE_FEDERATED_TOKEN_FILE" // ControlPlane machine label ControlPlane string = "master" // Node machine label Node string = "worker" // MachineRoleLabel machine label to determine the role MachineRoleLabel = "machine.openshift.io/cluster-api-machine-role" )
Variables ¶
This section is empty.
Functions ¶
func GetCloudEnvironment ¶
func GetCloudEnvironment(infra *configv1.Infrastructure) (string, string)
func GetInfrastructure ¶
func GetInfrastructure(client controllerclient.Client) (*configv1.Infrastructure, error)
func MachineConfigFromProviderSpec ¶
func MachineConfigFromProviderSpec(providerConfig machinev1.ProviderSpec) (*machinev1.AzureMachineProviderSpec, error)
MachineConfigFromProviderSpec tries to decode the JSON-encoded spec, falling back on getting a MachineClass if the value is absent.
func ProviderStatusFromRawExtension ¶
func ProviderStatusFromRawExtension(extension *runtime.RawExtension) (*machinev1.AzureMachineProviderStatus, error)
ProviderStatusFromRawExtension unmarshals a raw extension into an AzureMachineProviderStatus type.
func RawExtensionFromProviderSpec ¶
func RawExtensionFromProviderSpec(spec *machinev1.AzureMachineProviderSpec) (*runtime.RawExtension, error)
RawExtensionFromProviderSpec marshals AWSMachineProviderConfig into a raw extension type.
func RawExtensionFromProviderStatus ¶
func RawExtensionFromProviderStatus(status *machinev1.AzureMachineProviderStatus) (*runtime.RawExtension, error)
RawExtensionFromProviderStatus marshals AzureMachineProviderStatus into a raw extension type.
Types ¶
type AzureClients ¶
type AzureClients struct { SubscriptionID string Authorizer autorest.Authorizer ResourceManagerEndpoint string }
AzureClients contains all the Azure clients used by the scopes.
type MachineScope ¶
type MachineScope struct { context.Context AzureClients Machine *machinev1.Machine CoreClient controllerclient.Client MachineConfig *machinev1.AzureMachineProviderSpec MachineStatus *machinev1.AzureMachineProviderStatus ClusterName string // Tags is a list of tags to apply to the resources created // for the cluster Tags map[string]*string // 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 machine actuator operation.
func (*MachineScope) IsStackHub ¶
func (m *MachineScope) IsStackHub() bool
func (*MachineScope) Location ¶
func (m *MachineScope) Location() string
Location returns the machine location.
func (*MachineScope) Namespace ¶
func (m *MachineScope) Namespace() string
Namespace returns the machine namespace.
func (*MachineScope) PatchMachine ¶
func (m *MachineScope) PatchMachine() error
PatchMachine patch machine and machine status
func (*MachineScope) Persist ¶
func (m *MachineScope) Persist() error
Persist the machine spec and machine status.
func (*MachineScope) Role ¶
func (m *MachineScope) Role() string
Role returns the machine role from the labels.
type MachineScopeGetter ¶
type MachineScopeGetter interface {
GetMachineScope(params MachineScopeParams) (*MachineScope, error)
}
var (
DefaultMachineScopeGetter MachineScopeGetter = MachineScopeGetterFunc(NewMachineScope)
)
type MachineScopeGetterFunc ¶
type MachineScopeGetterFunc func(params MachineScopeParams) (*MachineScope, error)
func (MachineScopeGetterFunc) GetMachineScope ¶
func (f MachineScopeGetterFunc) GetMachineScope(params MachineScopeParams) (*MachineScope, error)
type MachineScopeParams ¶
type MachineScopeParams struct { AzureClients Machine *machinev1.Machine CoreClient controllerclient.Client AzureWorkloadIdentityEnabled bool }
MachineScopeParams defines the input parameters used to create a new MachineScope.