helper

package
v0.0.0-...-be4dc66 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Now = metav1.Now

Now determines the current metav1.Time.

Functions

func ConditionsNeedUpdate

func ConditionsNeedUpdate(existingConditions, newConditions []gardenv1beta1.Condition) bool

ConditionsNeedUpdate returns true if the <existingConditions> must be updated based on <newConditions>.

func DetermineCloudProviderInProfile

func DetermineCloudProviderInProfile(spec gardenv1beta1.CloudProfileSpec) (gardenv1beta1.CloudProvider, error)

DetermineCloudProviderInProfile takes a CloudProfile specification and returns the cloud provider this profile is used for. If it is not able to determine it, an error will be returned.

func DetermineCloudProviderInShoot

func DetermineCloudProviderInShoot(cloudObj gardenv1beta1.Cloud) (gardenv1beta1.CloudProvider, error)

DetermineCloudProviderInShoot takes a Shoot cloud object and returns the cloud provider this profile is used for. If it is not able to determine it, an error will be returned.

func DetermineLatestKubernetesVersion

func DetermineLatestKubernetesVersion(cloudProfile gardenv1beta1.CloudProfile, currentVersion string) (bool, string, error)

DetermineLatestKubernetesVersion finds the latest Kubernetes patch version in the <cloudProfile> compared to the given <currentVersion>. In case it does not find a newer patch version, it returns false. Otherwise, true and the found version will be returned.

func DetermineMachineImage

func DetermineMachineImage(cloudProfile gardenv1beta1.CloudProfile, name gardenv1beta1.MachineImageName, region string) (bool, interface{}, error)

DetermineMachineImage finds the cloud specific machine image in the <cloudProfile> for the given <name> and region. In case it does not find a machine image with the <name>, it returns false. Otherwise, true and the cloud-specific machine image object will be returned.

func ExtractErrorCodes

func ExtractErrorCodes(err error) []gardenv1beta1.ErrorCode

ExtractErrorCodes extracts all error codes from the given error by using utils.Errors

func FormatLastErrDescription

func FormatLastErrDescription(err error) string

func GetCondition

func GetCondition(conditions []gardenv1beta1.Condition, conditionType gardenv1beta1.ConditionType) *gardenv1beta1.Condition

GetCondition returns the condition with the given <conditionType> out of the list of <conditions>. In case the required type could not be found, it returns nil.

func GetMachineImageNameFromShoot

func GetMachineImageNameFromShoot(cloudProvider gardenv1beta1.CloudProvider, shoot *gardenv1beta1.Shoot) gardenv1beta1.MachineImageName

GetMachineImageNameFromShoot returns the machine image name used in a shoot manifest, however, it requires the cloudprovider as input.

func GetMachineTypesFromCloudProfile

func GetMachineTypesFromCloudProfile(cloudProvider gardenv1beta1.CloudProvider, profile *gardenv1beta1.CloudProfile) []gardenv1beta1.MachineType

GetMachineTypesFromCloudProfile retrieves list of machine types from cloud profile

func GetShootCloudProvider

func GetShootCloudProvider(shoot *gardenv1beta1.Shoot) (gardenv1beta1.CloudProvider, error)

GetShootCloudProvider retrieves the cloud provider used for the given Shoot.

func GetShootCloudProviderWorkers

func GetShootCloudProviderWorkers(cloudProvider gardenv1beta1.CloudProvider, shoot *gardenv1beta1.Shoot) []gardenv1beta1.Worker

GetShootCloudProviderWorkers retrieves the cloud-specific workers of the given Shoot.

func GetShootMachineImageName

func GetShootMachineImageName(shoot *gardenv1beta1.Shoot) (gardenv1beta1.MachineImageName, error)

GetShootMachineImageName returns the machine image name used in a shoot manifest.

func InitCondition

func InitCondition(conditionType gardenv1beta1.ConditionType, reason, message string) *gardenv1beta1.Condition

InitCondition initializes a new Condition with an Unknown status.

func IsShootHibernated

func IsShootHibernated(shoot *gardenv1beta1.Shoot) bool

IsShootHibernated checks if the given shoot is hibernated.

func NewConditions

func NewConditions(conditions []gardenv1beta1.Condition, conditionTypes ...gardenv1beta1.ConditionType) []*gardenv1beta1.Condition

NewConditions initializes the provided conditions based on an existing list. If a condition type does not exist in the list yet, it will be set to default values.

func ShootWantsAlertmanager

func ShootWantsAlertmanager(shoot *gardenv1beta1.Shoot, secrets map[string]*corev1.Secret) bool

ShootWantsAlertmanager checks if the given Shoot needs an Alertmanger.

func ShootWantsClusterAutoscaler

func ShootWantsClusterAutoscaler(shoot *gardenv1beta1.Shoot) (bool, error)

ShootWantsClusterAutoscaler checks if the given Shoot needs a cluster autoscaler. This is determined by checking whether one of the Shoot workers has a different AutoScalerMax than AutoScalerMin.

func UpdateMachineImage

func UpdateMachineImage(cloudProvider gardenv1beta1.CloudProvider, machineImage interface{}) func(*gardenv1beta1.Cloud)

UpdateMachineImage updates the machine image for the given cloud provider.

func UpdatedCondition

func UpdatedCondition(condition *gardenv1beta1.Condition, status gardenv1beta1.ConditionStatus, reason, message string) *gardenv1beta1.Condition

UpdatedCondition updates the properties of one specific condition.

func UpdatedConditionUnknownError

func UpdatedConditionUnknownError(condition *gardenv1beta1.Condition, err error) *gardenv1beta1.Condition

func UpdatedConditionUnknownErrorMessage

func UpdatedConditionUnknownErrorMessage(condition *gardenv1beta1.Condition, message string) *gardenv1beta1.Condition

Types

type Coder

type Coder interface {
	error
	Code() gardenv1beta1.ErrorCode
}

Coder is an error that may produce an ErrorCode visible to the outside.

type ShootedSeed

type ShootedSeed struct {
	Protected         *bool
	Visible           *bool
	MinimumVolumeSize *string
	APIServer         *ShootedSeedAPIServer
}

func ReadShootedSeed

func ReadShootedSeed(shoot *gardenv1beta1.Shoot) (*ShootedSeed, error)

ReadShootedSeed determines whether the Shoot has been marked to be registered automatically as a Seed cluster.

type ShootedSeedAPIServer

type ShootedSeedAPIServer struct {
	Replicas   *int32
	Autoscaler *ShootedSeedAPIServerAutoscaler
}

type ShootedSeedAPIServerAutoscaler

type ShootedSeedAPIServerAutoscaler struct {
	MinReplicas *int32
	MaxReplicas int32
}

Jump to

Keyboard shortcuts

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