stackit

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProjectID from the project controller
	ProjectID = "project-id"
	// SaKeyJSON serviceaccount.json from the STACKIT SA
	SaKeyJSON = "serviceaccount.json"
)
View Source
const (
	// Type is the type of resources managed by the STACKIT actuators.
	Type = "stackit"

	// Name is the name of the STACKIT provider.
	Name = "provider-stackit"

	EtherTypeIPv4    = "IPv4"
	EtherTypeIPv6    = "IPv6"
	DirectionEgress  = "egress"
	DirectionIngress = "ingress"
)

The SDK is lacking constants for well-known values of the security group rule fields.

Variables

View Source
var (
	ErrSecretNoData = errors.New("secret does not contain any data")
	ErrFieldMissing = errors.New("missing field in secret")
)
View Source
var (
	// ProtocolTCP is a shortcut for specifying a security group rule's protocol.
	ProtocolTCP = iaas.Protocol{Name: ptr.To("tcp")}
	// ProtocolUDP is a shortcut for specifying a security group rule's protocol.
	ProtocolUDP = iaas.Protocol{Name: ptr.To("udp")}
)
View Source
var Equality = conversion.EqualitiesOrDie(
	func(a, b iaas.Protocol) bool {

		return a.GetName() == b.GetName()
	},
)

Equality can do semantic deep equality checks for STACKIT SDK objects, similar to apiequality.Semantic. Example: stackit.Equality.DeepEqual(securityGroupRuleA, securityGroupRuleB) == true

View Source
var ProtocolComparison = cmp.Comparer(func(a, b iaas.Protocol) bool {

	return a.GetName() == b.GetName()
})

Functions

func DetermineRegion

func DetermineRegion(cluster *extensionscontroller.Cluster) string

DetermineRegion returns the STACKIT region (e.g., for IaaS API) of the shoot. It handles the legacy RegionOne value from the OpenStack CloudProfile and returns eu01 instead. TODO: Remove this once we migrated all Shoot specs from RegionOne to eu01.

func ToLabels

func ToLabels(labels map[string]string) map[string]any

ToLabels converts a usual labels map to a type that the SDK accepts.

Types

type Credentials

type Credentials struct {
	ProjectID                     string
	SaKeyJSON                     string
	LoadBalancerAPIEmergencyToken string
}

Credentials stores STACKIT credentials.

func GetCredentialsFromSecretRef

func GetCredentialsFromSecretRef(ctx context.Context, k8sClient client.Client, secretRef corev1.SecretReference) (*Credentials, error)

GetCredentialsFromSecretRef reads the secret given by the secret reference and returns the read Credentials object.

func ReadCredentialsSecret

func ReadCredentialsSecret(secret *corev1.Secret) (*Credentials, error)

ReadCredentialsSecret reads a secret containing credentials.

type LabelSelector

type LabelSelector map[string]string

func (LabelSelector) Matches

func (s LabelSelector) Matches(labels map[string]any) bool

Matches reports whether the labels of an SDK resource have all labels of this selector. I.e., additional labels on the resource are ignored.

Directories

Path Synopsis
mock
Package client is a generated GoMock package.
Package client is a generated GoMock package.
mock/dns
Package dns is a generated GoMock package.
Package dns is a generated GoMock package.
mock/iaas
Package iaas is a generated GoMock package.
Package iaas is a generated GoMock package.
mock/loadbalancer
Package loadbalancer is a generated GoMock package.
Package loadbalancer is a generated GoMock package.

Jump to

Keyboard shortcuts

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