v1alpha3

package
v4.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultClusterDescription is the default name for a cluster
	DefaultClusterDescription = "Unnamed cluster"

	// DefaultMasterReplicas is the default number of master node replicas
	DefaultMasterReplicas = 3

	// DefaultNodePoolAZs is the default number of AZs used in a nodepool
	DefaultNodePoolAZs = 1

	// DefaultMasterInstanceType is the default master instance type
	DefaultMasterInstanceType = "m5.xlarge"

	// FirstCAPIRelease is the first GS release that runs on CAPI controllers
	FirstCAPIRelease = "20.0.0-alpha1"

	// FirstHARelease is the first GS release for AWS that supports HA Masters
	FirstHARelease = "11.4.0"

	// FirstV1Alpha3Release is the first GS release for v1alpha3 GiantSwarm AWS CR's
	FirstV1Alpha3Release = "16.0.0"

	// FirstCiliumRelease is the first Cilium CNI GS release
	FirstCiliumRelease = "19.0.0-alpha1"

	// FirstOrgNamespaceRelease is the first GS release that creates Clusters in Org Namespaces by default
	FirstOrgNamespaceRelease = "16.0.0"

	// GiantSwarmLabelPart is the part of label keys that shows that they are protected giantswarm labels
	GiantSwarmLabelPart = "giantswarm.io"

	// GiantSwarmLabelPart is the part of label keys that shows that they are protected giantswarm labels
	ProviderTagLabelPart = "tag.provider.giantswarm.io"
)
View Source
const (
	// annotations should  taken from https://github.com/giantswarm/apiextensions/blob/master/pkg/annotation/aws.go
	// once the service is migrate to apiextensions v3
	AnnotationUpdateMaxBatchSize = "alpha.aws.giantswarm.io/update-max-batch-size"
	AnnotationUpdatePauseTime    = "alpha.aws.giantswarm.io/update-pause-time"

	AnnotationAlphaNodeTerminateUnhealthy = "alpha.node.giantswarm.io/terminate-unhealthy"
)

Variables

This section is empty.

Functions

func Contains

func Contains(s []string, e string) bool

func DefaultCredentialSecret

func DefaultCredentialSecret() types.NamespacedName

DefaultCredentialSecret returns the default credentials for clusters

func EscapeJSONPatchString

func EscapeJSONPatchString(input string) string

Ensure the needed escapes are in place. See https://tools.ietf.org/html/rfc6901#section-3 .

func FetchAWSCluster

func FetchAWSCluster(m *Handler, meta metav1.Object) (*infrastructurev1alpha3.AWSCluster, error)

func FetchCluster

func FetchCluster(m *Handler, meta metav1.Object) (*capi.Cluster, error)

func FetchNewestReleaseVersion

func FetchNewestReleaseVersion(m *Handler) (*semver.Version, error)

func FetchRelease

func FetchRelease(m *Handler, version *semver.Version) (*releasev1alpha1.Release, error)

func GetNavailabilityZones

func GetNavailabilityZones(m *Handler, n int, azs []string) []string

func GetReleaseComponentLabels

func GetReleaseComponentLabels(release releasev1alpha1.Release) map[string]string

func IsCAPIRelease

func IsCAPIRelease(meta metav1.Object) (bool, error)

func IsCAPIVersion

func IsCAPIVersion(releaseVersion *semver.Version) (bool, error)

IsCAPIVersion returns whether a given releaseVersion is using CAPI controllers

func IsCiliumRelease added in v4.2.0

func IsCiliumRelease(releaseVersion *semver.Version) bool

IsCiliumRelease returns whether a given releaseVersion is release with Cilium CNI

func IsGiantSwarmLabel

func IsGiantSwarmLabel(label string) bool

IsGiantSwarmLabel returns whether a label is considered a giantswarm label

func IsHAVersion

func IsHAVersion(releaseVersion *semver.Version) bool

IsHAVersion returns whether a given releaseVersion supports HA Masters

func IsIntegerGreaterThanZero

func IsIntegerGreaterThanZero(v string) bool

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsNotAllowed

func IsNotAllowed(err error) bool

IsNotAllowed asserts notAllowedError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

func IsOrgNamespaceVersion

func IsOrgNamespaceVersion(releaseVersion *semver.Version) bool

IsOrgNamespaceVersion returns whether a given releaseVersion creates clusters in org namespaces by default

func IsOrganizationLabelNotFoundError

func IsOrganizationLabelNotFoundError(err error) bool

IsOrganizationLabelNotFoundError asserts organizationLabelNotFoundError.

func IsOrganizationNotFoundError

func IsOrganizationNotFoundError(err error) bool

IsOrganizationNotFoundError asserts organizationNotFoundError.

func IsParsingFailed

func IsParsingFailed(err error) bool

IsParsingFailed asserts parsingFailedError.

func IsPreCiliumRelease added in v4.2.0

func IsPreCiliumRelease(releaseVersion *semver.Version) bool

IsPreCiliumRelease returns whether a given releaseVersion is a prerelease of Cilium CNI integration

func IsProviderTagLabel

func IsProviderTagLabel(label string) bool

IsProviderTagLabel returns whether a label is considered a provider tag label

func IsServicePriorityLabel added in v4.0.3

func IsServicePriorityLabel(l string) bool

IsServicePriorityLabel returns whether a label is the service priority label

func IsV1Alpha3Ready

func IsV1Alpha3Ready(releaseVersion *semver.Version) bool

IsV1Alpha3Ready returns whether a given releaseVersion is a valid v1alpha3 release

func IsValidAvailabilityZones

func IsValidAvailabilityZones(availabilityZones []string, validAvailabilityZones []string) bool

func IsValidMasterReplicas

func IsValidMasterReplicas(replicas int) bool

IsValidMasterReplicas returns whether a given number is a valid number of Master node replicas

func IsVersionLabel

func IsVersionLabel(label string) bool

IsVersionLabel returns whether a label is considered a version label

func IsVersionProductionReady

func IsVersionProductionReady(version *semver.Version) bool

IsVersionProductionReady returns whether a given releaseVersion is not a prerelease or test version

func MaxBatchSizeIsValid

func MaxBatchSizeIsValid(value string) bool

MaxBatchSizeIsValid will validate the value into valid maxBatchSize valid values can be either: an integer bigger than 0 a float between 0 < x <= 1 float value is used as ratio of a total worker count

func MutateCAPILabel

func MutateCAPILabel(m *Handler, meta metav1.Object) []mutator.PatchOperation

func MutateLabel

func MutateLabel(m *Handler, meta metav1.Object, label string, defaultValue string) ([]mutator.PatchOperation, error)

func MutateLabelFromAWSCluster

func MutateLabelFromAWSCluster(m *Handler, meta metav1.Object, awsCluster infrastructurev1alpha3.AWSCluster, label string) ([]mutator.PatchOperation, error)

func MutateLabelFromCluster

func MutateLabelFromCluster(m *Handler, meta metav1.Object, cluster capi.Cluster, label string) ([]mutator.PatchOperation, error)

func MutateLabelFromRelease

func MutateLabelFromRelease(m *Handler, meta metav1.Object, release releasev1alpha1.Release, label string, component string) ([]mutator.PatchOperation, error)

func PauseTimeIsValid

func PauseTimeIsValid(value string) bool

PauseTimeIsValid checks if the value is in proper ISO 8601 duration format and ensure the duration is not bigger than 1 Hour (AWS limitation)

func ReleaseVersion

func ReleaseVersion(meta metav1.Object, patch []mutator.PatchOperation) (*semver.Version, error)

func ValidLabelAdmins

func ValidLabelAdmins() []string

ValidLabelAdmins returns the list of accounts used to manipulate labels

func ValidMasterReplicas

func ValidMasterReplicas() []int

ValidMasterReplicas are the allowed number of master node replicas

func ValidateLabelKeys

func ValidateLabelKeys(m *Handler, old metav1.Object, new metav1.Object) error

func ValidateLabelValues

func ValidateLabelValues(m *Handler, old metav1.Object, new metav1.Object) error

func ValidateOperatorVersion

func ValidateOperatorVersion(meta metav1.Object) error

func ValidateOrgNamespace

func ValidateOrgNamespace(meta metav1.Object) error

func ValidateOrganizationLabelContainsExistingOrganization

func ValidateOrganizationLabelContainsExistingOrganization(ctx context.Context, ctrlClient client.Client, obj metav1.Object) error

func VersionLabels

func VersionLabels() []string

VersionLabels are the labels which are considered version labels

Types

type Handler

type Handler struct {
	K8sClient k8sclient.Interface
	Logger    micrologger.Logger
}

Directories

Path Synopsis
package awsmachinedeployment intercepts write activity to AWSMachineDeployment objects.
package awsmachinedeployment intercepts write activity to AWSMachineDeployment objects.
Package cluster intercepts write activity to Cluster objects.
Package cluster intercepts write activity to Cluster objects.
Package machinedeployment intercepts write activity to MachineDeployment objects.
Package machinedeployment intercepts write activity to MachineDeployment objects.

Jump to

Keyboard shortcuts

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