util

package
v0.0.0-...-0103f05 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperatorTagKey           = "kubernetes.io/aws-vpce-operator"
	OperatorTagValue         = "managed"
	RedHatManagedTagKey      = "red-hat-managed"
	RedHatManagedTagValue    = "true"
	SecurityGroupDescription = "Managed by AWS VPCE Operator"
	LegacyClusterTagPrefix   = "kubernetes.io/cluster"
	CapiClusterTagPrefix     = "sigs.k8s.io/cluster-api-provider-aws/cluster"
)

Variables

View Source
var SupportedInfraIDSuffixes = [...]string{"%s-master-sg", "%s-worker-sg", "%s-controlplane", "%s-node"}

These are the expected security group suffixes available in the VPC based on the cluster's infra id. NOTE: With 4.16+ the suffix changed to *-controlplane and *-node

Functions

func GenerateAwsTags

func GenerateAwsTags(name, clusterTagKey string) ([]types.Tag, error)

GenerateAwsTags returns the tags that should be reconciled on every AWS resource created by this operator

func GenerateAwsTagsAsMap

func GenerateAwsTagsAsMap(name, clusterTagKey string) (map[string]string, error)

GenerateAwsTagsAsMap converts the slice of tags returned by GenerateAwsTags into a map for convenience

func GenerateR53Tags

func GenerateR53Tags(clusterTagKey string) ([]route53Types.Tag, error)

GenerateR53Tags returns the tags that should be reconciled on every AWS resource created by this operator

func GenerateSecurityGroupName

func GenerateSecurityGroupName(clusterName, purpose string) (string, error)

GenerateSecurityGroupName generates a name for a security group given a cluster name and a "purpose" for the security group

func GenerateVPCEndpointName

func GenerateVPCEndpointName(clusterName, purpose string) (string, error)

GenerateVPCEndpointName generates a name for a VPC endpoint given a cluster name and a "purpose" for the VPC endpoint

func GetClusterCapiTagKey

func GetClusterCapiTagKey(infraName string) (string, error)

GetClusterCapiTagKey returns the tag assigned to all AWS resources for the given cluster in CAPI format

func GetClusterLegacyTagKey

func GetClusterLegacyTagKey(infraName string) (string, error)

GetClusterLegacyTagKey returns the tag assigned to all AWS resources for the given cluster

func StringSliceTwoWayDiff

func StringSliceTwoWayDiff(current, expected []string) ([]string, []string)

StringSliceTwoWayDiff returns the objects in expected that are not in current (to be used for creation) and the objects in current that are not in expected (to be used for deletion).

Types

This section is empty.

Jump to

Keyboard shortcuts

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