helper

package
v0.0.0-...-32fc51b Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2018 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 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 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 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 UpdatedCondition

func UpdatedCondition(condition *gardenv1beta1.Condition, status corev1.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
	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