helper

package
v2.22.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// KnownCodes maps Gardener error codes to respective regex.
	KnownCodes = map[gardencorev1beta1.ErrorCode]func(string) bool{
		gardencorev1beta1.ErrorInfraUnauthenticated:          unauthenticatedRegexp.MatchString,
		gardencorev1beta1.ErrorInfraUnauthorized:             unauthorizedRegexp.MatchString,
		gardencorev1beta1.ErrorInfraQuotaExceeded:            quotaExceededRegexp.MatchString,
		gardencorev1beta1.ErrorInfraRateLimitsExceeded:       rateLimitsExceededRegexp.MatchString,
		gardencorev1beta1.ErrorInfraDependencies:             dependenciesRegexp.MatchString,
		gardencorev1beta1.ErrorRetryableInfraDependencies:    retryableDependenciesRegexp.MatchString,
		gardencorev1beta1.ErrorInfraResourcesDepleted:        resourcesDepletedRegexp.MatchString,
		gardencorev1beta1.ErrorConfigurationProblem:          configurationProblemRegexp.MatchString,
		gardencorev1beta1.ErrorRetryableConfigurationProblem: retryableConfigurationProblemRegexp.MatchString,
	}
)
View Source
var (
	// Scheme is a scheme with the types relevant for OpenStack actuators.
	Scheme *runtime.Scheme
)

Functions

func CloudProfileConfigFromCluster

func CloudProfileConfigFromCluster(cluster *controller.Cluster) (*stackitv1alpha1.CloudProfileConfig, error)

CloudProfileConfigFromCluster decodes the provider specific cloud profile configuration for a cluster

func CloudProfileConfigFromRawExtension

func CloudProfileConfigFromRawExtension(raw *runtime.RawExtension) (*stackitv1alpha1.CloudProfileConfig, error)

func ControlPlaneConfigFromCluster

func ControlPlaneConfigFromCluster(cluster *controller.Cluster) (*stackitv1alpha1.ControlPlaneConfig, error)

ControlPlaneConfigFromCluster retrieves the ControlPlaneConfig from the Cluster. Returns nil if decoding fails

func ControlPlaneConfigFromRawExtension added in v2.16.0

func ControlPlaneConfigFromRawExtension(raw *runtime.RawExtension) (*stackitv1alpha1.ControlPlaneConfig, error)

func FindFloatingPool

func FindFloatingPool(floatingPools []stackitv1alpha1.FloatingPool, floatingPoolNamePattern, region string, domain *string) (*stackitv1alpha1.FloatingPool, error)

FindFloatingPool receives a list of floating pools and tries to find the best match for a given `floatingPoolNamePattern` considering constraints like `region` and `domain`. If no matching floating pool was found then an error will be returned.

func FindImageInCloudProfile added in v2.22.0

func FindImageInCloudProfile(
	cloudProfileConfig *stackitv1alpha1.CloudProfileConfig,
	name, version, region string,
	machineCapabilities gardencorev1beta1.Capabilities,
	capabilityDefinitions []gardencorev1beta1.CapabilityDefinition,
) (*stackitv1alpha1.MachineImageFlavor, error)

FindImageInCloudProfile takes a list of machine images and tries to find the first entry whose name, version and capabilities matches with the machineTypeCapabilities. If no such entry is found then an error will be returned. Note: capabilityDefinitions and machineTypeCapabilities are expected to be normalized by the caller using NormalizeCapabilityDefinitions() and NormalizeMachineTypeCapabilities()

func FindImageInWorkerStatus added in v2.22.0

func FindImageInWorkerStatus(machineImages []stackitv1alpha1.MachineImage, name string, version string, architecture string, machineCapabilities gardencorev1beta1.Capabilities, capabilityDefinitions []gardencorev1beta1.CapabilityDefinition) (*stackitv1alpha1.MachineImage, error)

FindImageInWorkerStatus takes a list of machine images from the worker status and tries to find the first entry whose name, version, architecture capabilities and zone matches with the machineTypeCapabilities. If no such entry is found then an error will be returned. The worker status is an external source that may contain images in either legacy format (Architecture field) or capability format (Capabilities field). The capabilityDefinitions parameter should be the original (non-normalized) spec.MachineCapabilities from the CloudProfile to distinguish the two cases. An empty architecture is treated as the default architecture (amd64).

func FindKeyStoneCACert

func FindKeyStoneCACert(keyStoneURLs []stackitv1alpha1.KeyStoneURL, keystoneCABundle *string, region string) *string

FindKeyStoneCACert takes a list of keystone URLs and tries to find the first entry whose region matches with the given region and returns the CA cert for this region. If no such entry is found then it tries to use the non-regional value.

func FindKeyStoneURL

func FindKeyStoneURL(keyStoneURLs []stackitv1alpha1.KeyStoneURL, keystoneURL, region string) (string, error)

FindKeyStoneURL takes a list of keystone URLs and tries to find the first entry whose region matches with the given region. If no such entry is found then it tries to use the non-regional keystone URL. If this is not specified then an error will be returned.

func FindSecurityGroupByPurpose

func FindSecurityGroupByPurpose(securityGroups []stackitv1alpha1.SecurityGroup, purpose stackitv1alpha1.Purpose) (*stackitv1alpha1.SecurityGroup, error)

FindSecurityGroupByPurpose takes a list of security groups and tries to find the first entry whose purpose matches with the given purpose. If no such entry is found then an error will be returned.

func FindSubnetByPurpose

func FindSubnetByPurpose(subnets []stackitv1alpha1.Subnet, purpose stackitv1alpha1.Purpose) (*stackitv1alpha1.Subnet, error)

FindSubnetByPurpose takes a list of subnets and tries to find the first entry whose purpose matches with the given purpose. If no such entry is found then an error will be returned.

func InfrastructureConfigFromInfrastructure

func InfrastructureConfigFromInfrastructure(infra *extensionsv1alpha1.Infrastructure) (*stackitv1alpha1.InfrastructureConfig, error)

InfrastructureConfigFromInfrastructure extracts the InfrastructureConfig from the ProviderConfig section of the given Infrastructure.

func InfrastructureConfigFromRawExtension

func InfrastructureConfigFromRawExtension(raw *runtime.RawExtension) (*stackitv1alpha1.InfrastructureConfig, error)

InfrastructureConfigFromRawExtension extracts the InfrastructureConfig from the ProviderConfig.

func InfrastructureStatusFromRaw

func InfrastructureStatusFromRaw(raw *runtime.RawExtension) (*stackitv1alpha1.InfrastructureStatus, error)

InfrastructureStatusFromRaw extracts the InfrastructureStatus from the ProviderStatus section of the given Infrastructure.

func NormalizeCapabilityDefinitions added in v2.22.0

func NormalizeCapabilityDefinitions(capabilityDefinitions []gardencorev1beta1.CapabilityDefinition) []gardencorev1beta1.CapabilityDefinition

NormalizeCapabilityDefinitions ensures that capability definitions always include at least the architecture capability. This allows all downstream code to assume capabilities are always present, eliminating the need for conditional logic based on whether capabilities are defined.

func NormalizeMachineTypeCapabilities added in v2.22.0

func NormalizeMachineTypeCapabilities(capabilities gardencorev1beta1.Capabilities, workerArchitecture *string, capabilityDefinitions []gardencorev1beta1.CapabilityDefinition) gardencorev1beta1.Capabilities

NormalizeMachineTypeCapabilities ensures that machine type capabilities include the architecture capability. This transforms the legacy architecture-based selection into capability-based selection. The architecture is determined in the following priority order: 1. If capabilities already has architecture, use it as-is 2. If capabilityDefinitions has exactly one architecture value, use that value 3. Otherwise, use workerArchitecture (defaulting to amd64)

func WorkerConfigFromRawExtension

func WorkerConfigFromRawExtension(raw *runtime.RawExtension) (*stackitv1alpha1.WorkerConfig, error)

WorkerConfigFromRawExtension extracts the provider specific configuration for a worker pool.

Types

This section is empty.

Jump to

Keyboard shortcuts

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