v1alpha3

package
v3.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 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"

	// 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 added in v3.2.0

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) (*capiv1alpha3.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 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 added in v3.3.0

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 IsProviderTagLabel added in v3.2.1

func IsProviderTagLabel(label string) bool

IsProviderTagLabel returns whether a label is considered a provider tag label

func IsV1Alpha3Ready

func IsV1Alpha3Ready(releaseVersion *semver.Version) bool

IsV1Alpha3Ready returns whether a given releaseVersion is a valid v1alpha3 release

func IsValidAvailabilityZones added in v3.2.0

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 added in v3.1.0

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 capiv1alpha3.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 added in v3.4.0

func ValidateOperatorVersion(meta metav1.Object) error

func ValidateOrgNamespace added in v3.3.0

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