gardener: github.com/gardener/gardener/pkg/apis/core/v1beta1/helper Index | Files

package helper

import "github.com/gardener/gardener/pkg/apis/core/v1beta1/helper"

Index

Package Files

condition_builder.go errors.go helper.go

Variables

var Now = metav1.Now

Now determines the current metav1.Time.

func ComputeOperationType Uses

func ComputeOperationType(meta metav1.ObjectMeta, lastOperation *gardencorev1beta1.LastOperation) gardencorev1beta1.LastOperationType

ComputeOperationType checksthe <lastOperation> and determines whether is it is Create operation or reconcile operation

func ConditionsNeedUpdate Uses

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

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

func DetermineError Uses

func DetermineError(err error, message string) error

DetermineError determines the Garden error code for the given error and creates a new error with the given message.

func DetermineLatestKubernetesPatchVersion Uses

func DetermineLatestKubernetesPatchVersion(cloudProfile *gardencorev1beta1.CloudProfile, currentVersion string) (bool, string, error)

DetermineLatestKubernetesPatchVersion 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 DetermineLatestMachineImageVersion Uses

func DetermineLatestMachineImageVersion(image gardencorev1beta1.MachineImage) (*semver.Version, gardencorev1beta1.ExpirableVersion, error)

DetermineLatestMachineImageVersion determines the latest MachineImageVersion from a MachineImage

func DetermineMachineImageForName Uses

func DetermineMachineImageForName(cloudProfile *gardencorev1beta1.CloudProfile, name string) (bool, gardencorev1beta1.MachineImage, error)

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

func DetermineNextKubernetesMinorVersion Uses

func DetermineNextKubernetesMinorVersion(cloudProfile *gardencorev1beta1.CloudProfile, currentVersion string) (bool, string, error)

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

func ExtractErrorCodes Uses

func ExtractErrorCodes(err error) []gardencorev1beta1.ErrorCode

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

func FindPrimaryDNSProvider Uses

func FindPrimaryDNSProvider(providers []gardencorev1beta1.DNSProvider) *gardencorev1beta1.DNSProvider

FindPrimaryDNSProvider finds the primary provider among the given `providers`. It returns the first provider in case no primary provider is available or the first one if multiple candidates are found.

func FormatLastErrDescription Uses

func FormatLastErrDescription(err error) string

FormatLastErrDescription formats the error message string for the last occurred error.

func GetCondition Uses

func GetCondition(conditions []gardencorev1beta1.Condition, conditionType gardencorev1beta1.ConditionType) *gardencorev1beta1.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 GetDefaultMachineImageFromCloudProfile Uses

func GetDefaultMachineImageFromCloudProfile(profile gardencorev1beta1.CloudProfile) *gardencorev1beta1.MachineImage

GetDefaultMachineImageFromCloudProfile gets the first MachineImage from the CloudProfile

func GetMachineImagesFor Uses

func GetMachineImagesFor(shoot *gardencorev1beta1.Shoot) []*gardencorev1beta1.ShootMachineImage

GetMachineImagesFor returns a list of all machine images for a given shoot.

func GetOrInitCondition Uses

func GetOrInitCondition(conditions []gardencorev1beta1.Condition, conditionType gardencorev1beta1.ConditionType) gardencorev1beta1.Condition

GetOrInitCondition tries to retrieve the condition with the given condition type from the given conditions. If the condition could not be found, it returns an initialized condition of the given type.

func GetShootMachineImageFromLatestMachineImageVersion Uses

func GetShootMachineImageFromLatestMachineImageVersion(image gardencorev1beta1.MachineImage) (*semver.Version, gardencorev1beta1.ShootMachineImage, error)

GetShootMachineImageFromLatestMachineImageVersion determines the latest version in a machine image and returns that as a ShootMachineImage

func HibernationIsEnabled Uses

func HibernationIsEnabled(shoot *gardencorev1beta1.Shoot) bool

HibernationIsEnabled checks if the given shoot's desired state is hibernated.

func InitCondition Uses

func InitCondition(conditionType gardencorev1beta1.ConditionType) gardencorev1beta1.Condition

InitCondition initializes a new Condition with an Unknown status.

func IsAPIServerExposureManaged Uses

func IsAPIServerExposureManaged(obj metav1.Object) bool

IsAPIServerExposureManaged returns true, if the Object is managed by Gardener for API server exposure. This indicates to extensions that they should not mutate the object. Gardener marks the kube-apiserver Service and Deployment as managed by it when it uses SNI to expose them.

func IsControllerInstallationSuccessful Uses

func IsControllerInstallationSuccessful(controllerInstallation gardencorev1beta1.ControllerInstallation) bool

IsControllerInstallationSuccessful returns true if a ControllerInstallation has been marked as "successfully" installed.

func IsResourceSupported Uses

func IsResourceSupported(resources []gardencorev1beta1.ControllerResource, resourceKind, resourceType string) bool

IsResourceSupported returns true if a given combination of kind/type is part of a controller resources list.

func KubernetesVersionExistsInCloudProfile Uses

func KubernetesVersionExistsInCloudProfile(cloudProfile *gardencorev1beta1.CloudProfile, currentVersion string) (bool, gardencorev1beta1.ExpirableVersion, error)

KubernetesVersionExistsInCloudProfile checks if the given Kubernetes version exists in the CloudProfile

func LastError Uses

func LastError(description string, codes ...gardencorev1beta1.ErrorCode) *gardencorev1beta1.LastError

LastError creates a new LastError with the given description, optional codes and sets timestamp when the error is lastly observed.

func LastErrorWithTaskID Uses

func LastErrorWithTaskID(description string, taskID string, codes ...gardencorev1beta1.ErrorCode) *gardencorev1beta1.LastError

LastErrorWithTaskID creates a new LastError with the given description, the ID of the task when the error occurred, optional codes and sets timestamp when the error is lastly observed.

func MergeConditions Uses

func MergeConditions(oldConditions []gardencorev1beta1.Condition, newConditions ...gardencorev1beta1.Condition) []gardencorev1beta1.Condition

MergeConditions merges the given <oldConditions> with the <newConditions>. Existing conditions are superseded by the <newConditions> (depending on the condition type).

func NewConditions Uses

func NewConditions(conditions []gardencorev1beta1.Condition, conditionTypes ...gardencorev1beta1.ConditionType) []*gardencorev1beta1.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 NewErrorWithCode Uses

func NewErrorWithCode(code gardencorev1beta1.ErrorCode, message string) error

NewErrorWithCode creates a new error that additionally exposes the given code via the Coder interface.

func SetMachineImageVersionsToMachineImage Uses

func SetMachineImageVersionsToMachineImage(machineImages []gardencorev1beta1.MachineImage, imageName string, imageVersions []gardencorev1beta1.ExpirableVersion) ([]gardencorev1beta1.MachineImage, error)

SetMachineImageVersionsToMachineImage sets imageVersions to the matching imageName in the machineImages.

func ShootIgnoresAlerts Uses

func ShootIgnoresAlerts(shoot *gardencorev1beta1.Shoot) bool

ShootIgnoresAlerts checks if the alerts for the annotated shoot cluster should be ignored.

func ShootMachineImageVersionExists Uses

func ShootMachineImageVersionExists(constraint gardencorev1beta1.MachineImage, image gardencorev1beta1.ShootMachineImage) (bool, int)

ShootMachineImageVersionExists checks if the shoot machine image (name, version) exists in the machine image constraint and returns true if yes and the index in the versions slice

func ShootUsesUnmanagedDNS Uses

func ShootUsesUnmanagedDNS(shoot *gardencorev1beta1.Shoot) bool

ShootUsesUnmanagedDNS returns true if the shoot's DNS section is marked as 'unmanaged'.

func ShootWantsBasicAuthentication Uses

func ShootWantsBasicAuthentication(shoot *gardencorev1beta1.Shoot) bool

ShootWantsBasicAuthentication returns true if basic authentication is not configured or if it is set explicitly to 'true'.

func ShootWantsClusterAutoscaler Uses

func ShootWantsClusterAutoscaler(shoot *gardencorev1beta1.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 Maximum than Minimum.

func TaintsHave Uses

func TaintsHave(taints []gardencorev1beta1.SeedTaint, key string) bool

TaintsHave returns true if the given key is part of the taints list.

func UpdateMachineImages Uses

func UpdateMachineImages(workers []gardencorev1beta1.Worker, machineImages []*gardencorev1beta1.ShootMachineImage)

UpdateMachineImages updates the machine images in place.

func UpdatedCondition Uses

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

UpdatedCondition updates the properties of one specific condition.

func UpdatedConditionUnknownError Uses

func UpdatedConditionUnknownError(condition gardencorev1beta1.Condition, err error) gardencorev1beta1.Condition

func UpdatedConditionUnknownErrorMessage Uses

func UpdatedConditionUnknownErrorMessage(condition gardencorev1beta1.Condition, message string) gardencorev1beta1.Condition

func WrapWithLastError Uses

func WrapWithLastError(err error, lastError *gardencorev1beta1.LastError) error

WrapWithLastError is wrapper function for gardencorev1beta1.LastError

type Coder Uses

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

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

type ConditionBuilder Uses

type ConditionBuilder interface {
    WithOldCondition(old api.Condition) ConditionBuilder
    WithStatus(status api.ConditionStatus) ConditionBuilder
    WithReason(reason string) ConditionBuilder
    WithMessage(message string) ConditionBuilder
    WithNowFunc(now func() metav1.Time) ConditionBuilder
    Build() (new api.Condition, updated bool)
}

ConditionBuilder build a Condition.

func NewConditionBuilder Uses

func NewConditionBuilder(conditionType api.ConditionType) (ConditionBuilder, error)

NewConditionBuilder returns a ConditionBuilder for a specific condition.

type ShootedSeed Uses

type ShootedSeed struct {
    DisableDNS                     *bool
    DisableCapacityReservation     *bool
    Protected                      *bool
    Visible                        *bool
    MinimumVolumeSize              *string
    APIServer                      *ShootedSeedAPIServer
    BlockCIDRs                     []string
    ShootDefaults                  *gardencorev1beta1.ShootNetworks
    Backup                         *gardencorev1beta1.SeedBackup
    NoGardenlet                    bool
    UseServiceAccountBootstrapping bool
    WithSecretRef                  bool
}

func ReadShootedSeed Uses

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

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

type ShootedSeedAPIServer Uses

type ShootedSeedAPIServer struct {
    Replicas   *int32
    Autoscaler *ShootedSeedAPIServerAutoscaler
}

type ShootedSeedAPIServerAutoscaler Uses

type ShootedSeedAPIServerAutoscaler struct {
    MinReplicas *int32
    MaxReplicas int32
}

type WrappedLastErrors Uses

type WrappedLastErrors struct {
    Description string
    LastErrors  []gardencorev1beta1.LastError
}

WrappedLastErrors is a structure which contains the general description of the lastErrors which occurred and an array of all lastErrors

func NewWrappedLastErrors Uses

func NewWrappedLastErrors(description string, err error) *WrappedLastErrors

NewWrappedLastErrors returns an error

Package helper imports 17 packages (graph) and is imported by 31 packages. Updated 2020-04-07. Refresh now. Tools for package owners.