Documentation ¶
Index ¶
- func BootstrapTokenFrom(data map[string][]byte) string
- func ComputeBootstrapToken(ctx context.Context, c client.Client, tokenID, description string, ...) (secret *corev1.Secret, err error)
- func CreateOrUpdateSecretByReference(ctx context.Context, c client.Client, ref *corev1.SecretReference, ...) error
- func CreateTwoWayMergePatch(obj1 metav1.Object, obj2 metav1.Object) ([]byte, error)
- func DNSNamesForService(name, namespace string) []string
- func DeleteObject(ctx context.Context, c client.Client, object client.Object) error
- func DeleteObjects(ctx context.Context, c client.Client, objects ...client.Object) error
- func DeleteObjectsFromListConditionally(ctx context.Context, c client.Client, listObj client.ObjectList, ...) error
- func DeleteSecretByReference(ctx context.Context, c client.Client, ref *corev1.SecretReference) error
- func FeatureGatesToCommandLineParameter(fg map[string]bool) string
- func FetchEventMessages(ctx context.Context, c client.Client, obj client.Object, eventType string, ...) (string, error)
- func GetLoadBalancerIngress(ctx context.Context, c client.Client, service *corev1.Service) (string, error)
- func GetManagedSeed(ctx context.Context, ...) (*seedmanagementv1alpha1.ManagedSeed, error)
- func GetSecretByReference(ctx context.Context, c client.Client, ref *corev1.SecretReference) (*corev1.Secret, error)
- func HasMetaDataAnnotation(meta metav1.Object, key, value string) bool
- func IsEmptyPatch(patch []byte) bool
- func Key(namespaceOrName string, nameOpt ...string) client.ObjectKey
- func LookupObject(ctx context.Context, c client.Client, apiReader client.Reader, ...) error
- func MergeOwnerReferences(references []metav1.OwnerReference, newReferences ...metav1.OwnerReference) []metav1.OwnerReference
- func MostRecentCompleteLogs(ctx context.Context, podInterface corev1client.PodInterface, pod *corev1.Pod, ...) (string, error)
- func NewestObject(ctx context.Context, c client.Client, listObj client.ObjectList, ...) (client.Object, error)
- func NewestPodForDeployment(ctx context.Context, c client.Client, deployment *appsv1.Deployment) (*corev1.Pod, error)
- func ObjectMeta(namespaceOrName string, nameOpt ...string) metav1.ObjectMeta
- func ObjectMetaFromKey(key client.ObjectKey) metav1.ObjectMeta
- func ObjectName(obj client.Object) string
- func OwnedBy(obj client.Object, apiVersion, kind, name string, uid types.UID) bool
- func ReadLeaderElectionRecord(ctx context.Context, client client.Client, lock, namespace, name string) (*resourcelock.LeaderElectionRecord, error)
- func ReconcileServicePorts(existingPorts []corev1.ServicePort, desiredPorts []corev1.ServicePort) []corev1.ServicePort
- func SetMetaDataAnnotation(meta metav1.Object, key, value string)
- func SetMetaDataLabel(meta metav1.Object, key, value string)
- func SubmitEmptyPatch(ctx context.Context, c client.Client, obj client.Object) error
- func TruncateLabelValue(s string) string
- func TryPatch(ctx context.Context, backoff wait.Backoff, c client.Client, obj client.Object, ...) error
- func TryPatchStatus(ctx context.Context, backoff wait.Backoff, c client.Client, obj client.Object, ...) error
- func TryUpdate(ctx context.Context, backoff wait.Backoff, c client.Client, obj client.Object, ...) error
- func TryUpdateControllerInstallation(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.ControllerInstallation, error)
- func TryUpdateControllerInstallationStatus(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.ControllerInstallation, error)
- func TryUpdateControllerInstallationStatusWithEqualFunc(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.ControllerInstallation, error)
- func TryUpdateControllerInstallationWithEqualFunc(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.ControllerInstallation, error)
- func TryUpdateControllerRegistration(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.ControllerRegistration, error)
- func TryUpdateControllerRegistrationWithEqualFunc(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.ControllerRegistration, error)
- func TryUpdateNamespace(ctx context.Context, k k8s.Interface, backoff wait.Backoff, ...) (*corev1.Namespace, error)
- func TryUpdateNamespaceLabels(ctx context.Context, k k8s.Interface, backoff wait.Backoff, ...) (*corev1.Namespace, error)
- func TryUpdateProject(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.Project, error)
- func TryUpdateProjectStatus(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.Project, error)
- func TryUpdateSeed(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.Seed, error)
- func TryUpdateSeedConditions(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.Seed, error)
- func TryUpdateSeedStatus(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.Seed, error)
- func TryUpdateSeedWithEqualFunc(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.Seed, error)
- func TryUpdateShoot(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.Shoot, error)
- func TryUpdateShootHibernation(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.Shoot, error)
- func TryUpdateShootStatus(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, ...) (*gardencorev1beta1.Shoot, error)
- func TryUpdateStatus(ctx context.Context, backoff wait.Backoff, c client.Client, obj client.Object, ...) error
- func ValidDeploymentContainerImageVersion(deploymentToCheck *appsv1.Deployment, containerName, minimumVersion string) (bool, error)
- func WaitUntilLoadBalancerIsReady(ctx context.Context, kubeClient kubernetes.Interface, namespace, name string, ...) (string, error)
- func WaitUntilResourceDeleted(ctx context.Context, c client.Client, obj client.Object, ...) error
- func WaitUntilResourceDeletedWithDefaults(ctx context.Context, c client.Client, obj client.Object) error
- func WaitUntilResourcesDeleted(ctx context.Context, c client.Client, list client.ObjectList, ...) error
- type DaemonSetLister
- type DaemonSetNamespaceLister
- type DaemonSetSource
- type DeploymentLister
- type DeploymentNamespaceLister
- type DeploymentSource
- type EtcdLister
- type EtcdNamespaceLister
- type EtcdSource
- type SortBy
- type StatefulSetLister
- type StatefulSetNamespaceLister
- type StatefulSetSource
- type WorkerLister
- type WorkerNamespaceLister
- type WorkerSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BootstrapTokenFrom ¶ added in v0.33.0
BootstrapTokenFrom returns the bootstrap token based on the secret data.
func ComputeBootstrapToken ¶ added in v0.33.0
func ComputeBootstrapToken(ctx context.Context, c client.Client, tokenID, description string, validity time.Duration) (secret *corev1.Secret, err error)
ComputeBootstrapToken computes and creates a new bootstrap token, and returns it.
func CreateOrUpdateSecretByReference ¶ added in v1.17.0
func CreateOrUpdateSecretByReference(ctx context.Context, c client.Client, ref *corev1.SecretReference, secretType corev1.SecretType, data map[string][]byte, ownerRefs []metav1.OwnerReference) error
CreateOrUpdateSecretByReference creates or updates the secret referenced by the given secret reference with the given type, data, and owner references.
func CreateTwoWayMergePatch ¶
CreateTwoWayMergePatch creates a two way merge patch of the given objects. The two objects have to be pointers implementing the interfaces.
func DNSNamesForService ¶ added in v1.8.0
DNSNamesForService returns the possible DNS names for a service with the given name and namespace.
func DeleteObject ¶ added in v1.11.0
DeleteObject deletes a Kubernetes object. It ignores 'not found' and 'no match' errors.
func DeleteObjects ¶ added in v1.11.0
DeleteObjects deletes a list of Kubernetes objects.
func DeleteObjectsFromListConditionally ¶ added in v1.17.0
func DeleteObjectsFromListConditionally(ctx context.Context, c client.Client, listObj client.ObjectList, predicateFn func(runtime.Object) bool) error
DeleteObjectsFromListConditionally takes a Kubernetes List object. It iterates over its items and, if provided, executes the predicate function. If it evaluates to true then the object will be deleted.
func DeleteSecretByReference ¶ added in v1.17.0
func DeleteSecretByReference(ctx context.Context, c client.Client, ref *corev1.SecretReference) error
DeleteSecretByReference deletes the secret referenced by the given secret reference.
func FeatureGatesToCommandLineParameter ¶ added in v1.10.0
FeatureGatesToCommandLineParameter transforms feature gates given as string/bool map to a command line parameter that is understood by Kubernetes components.
func FetchEventMessages ¶ added in v1.17.0
func FetchEventMessages(ctx context.Context, c client.Client, obj client.Object, eventType string, eventsLimit int) (string, error)
FetchEventMessages gets events for the given object of the given `eventType` and returns them as a formatted output. The function expects that the given `obj` is specified with a proper `metav1.TypeMeta`.
func GetLoadBalancerIngress ¶
func GetLoadBalancerIngress(ctx context.Context, c client.Client, service *corev1.Service) (string, error)
GetLoadBalancerIngress takes a context, a client, a service object. It gets the `service` and queries for a load balancer's technical name (ip address or hostname). It returns the value of the technical name whereby it always prefers the hostname (if given) over the IP address. The passed `service` instance is updated with the information received from the API server.
func GetManagedSeed ¶ added in v1.17.0
func GetManagedSeed(ctx context.Context, seedManagementClient gardenseedmanagementclientset.Interface, shootNamespace, shootName string) (*seedmanagementv1alpha1.ManagedSeed, error)
GetManagedSeed gets the ManagedSeed resource for the given shoot namespace and name, by searching for all ManagedSeeds in the shoot namespace that have spec.shoot.name set to the shoot name. If no such ManagedSeeds are found, nil is returned.
func GetSecretByReference ¶ added in v1.17.0
func GetSecretByReference(ctx context.Context, c client.Client, ref *corev1.SecretReference) (*corev1.Secret, error)
GetSecretByReference returns the secret referenced by the given secret reference.
func HasMetaDataAnnotation ¶
HasMetaDataAnnotation checks if the passed meta object has the given key, value set in the annotations section.
func IsEmptyPatch ¶
IsEmptyPatch checks if the given patch is empty. A patch is considered empty if it is the empty string or if it json-decodes to an empty json map.
func Key ¶
Key creates a new client.ObjectKey from the given parameters. There are only two ways to call this function:
- If only namespaceOrName is set, then a client.ObjectKey with name set to namespaceOrName is returned.
- If namespaceOrName and one nameOpt is given, then a client.ObjectKey with namespace set to namespaceOrName and name set to nameOpt[0] is returned.
For all other cases, this method panics.
func LookupObject ¶ added in v1.7.0
func LookupObject(ctx context.Context, c client.Client, apiReader client.Reader, key client.ObjectKey, obj client.Object) error
LookupObject retrieves an obj for the given object key dealing with potential stale cache that still does not contain the obj. It first tries to retrieve the obj using the given cached client. If the object key is not found, then it does live lookup from the API server using the given apiReader.
func MergeOwnerReferences ¶ added in v1.16.0
func MergeOwnerReferences(references []metav1.OwnerReference, newReferences ...metav1.OwnerReference) []metav1.OwnerReference
MergeOwnerReferences merges the newReferences with the list of existing references.
func MostRecentCompleteLogs ¶ added in v1.16.0
func MostRecentCompleteLogs( ctx context.Context, podInterface corev1client.PodInterface, pod *corev1.Pod, containerName string, tailLines *int64, ) ( string, error, )
MostRecentCompleteLogs returns the logs of the pod/container in case it is not running. If the pod/container is running then the logs of the previous pod/container are being returned.
func NewestObject ¶ added in v1.16.0
func NewestObject(ctx context.Context, c client.Client, listObj client.ObjectList, filterFn func(client.Object) bool, listOpts ...client.ListOption) (client.Object, error)
NewestObject returns the most recently created object based on the provided list object type. If a filter function is provided then it will be applied for each object right after listing all objects. If no object remains then nil is returned. The Items field in the list object will be populated with the result returned from the server after applying the filter function (if provided).
func NewestPodForDeployment ¶ added in v1.16.0
func NewestPodForDeployment(ctx context.Context, c client.Client, deployment *appsv1.Deployment) (*corev1.Pod, error)
NewestPodForDeployment returns the most recently created Pod object for the given deployment.
func ObjectMeta ¶
func ObjectMeta(namespaceOrName string, nameOpt ...string) metav1.ObjectMeta
ObjectMeta creates a new metav1.ObjectMeta from the given parameters. There are only two ways to call this function:
- If only namespaceOrName is set, then a metav1.ObjectMeta with name set to namespaceOrName is returned.
- If namespaceOrName and one nameOpt is given, then a metav1.ObjectMeta with namespace set to namespaceOrName and name set to nameOpt[0] is returned.
For all other cases, this method panics.
func ObjectMetaFromKey ¶
func ObjectMetaFromKey(key client.ObjectKey) metav1.ObjectMeta
ObjectMetaFromKey returns an ObjectMeta with the namespace and name set to the values from the key.
func ObjectName ¶ added in v1.8.0
ObjectName returns the name of the given object in the format <namespace>/<name>
func OwnedBy ¶ added in v1.16.0
OwnedBy checks if the given object's owner reference contains an entry with the provided attributes.
func ReadLeaderElectionRecord ¶ added in v1.15.0
func ReadLeaderElectionRecord(ctx context.Context, client client.Client, lock, namespace, name string) (*resourcelock.LeaderElectionRecord, error)
ReadLeaderElectionRecord returns the leader election record for a given lock type and a namespace/name combination.
func ReconcileServicePorts ¶ added in v1.10.0
func ReconcileServicePorts(existingPorts []corev1.ServicePort, desiredPorts []corev1.ServicePort) []corev1.ServicePort
ReconcileServicePorts reconciles the existing service ports with the desired ports. This means that it takes the existing port (identified by name), and applies the settings from the desired port to it. This way it can keep fields that are defaulted by controllers, e.g. the node port. However, it does not keep ports that are not part of the desired list.
func SetMetaDataAnnotation ¶
SetMetaDataAnnotation sets the annotation on the given object. If the given Object did not yet have annotations, they are initialized.
func SetMetaDataLabel ¶
SetMetaDataLabel sets the key value pair in the labels section of the given Object. If the given Object did not yet have labels, they are initialized.
func SubmitEmptyPatch ¶
SubmitEmptyPatch submits an empty patch to the given `obj` with the given `client` instance.
func TruncateLabelValue ¶
TruncateLabelValue truncates a string at 63 characters so it's suitable for a label value.
func TryPatch ¶ added in v1.12.0
func TryPatch(ctx context.Context, backoff wait.Backoff, c client.Client, obj client.Object, transform func() error) error
TryPatch tries to apply the given transformation function onto the given object, and to patch it afterwards with optimistic locking. It retries the patch with an exponential backoff.
func TryPatchStatus ¶ added in v1.12.0
func TryPatchStatus(ctx context.Context, backoff wait.Backoff, c client.Client, obj client.Object, transform func() error) error
TryPatchStatus tries to apply the given transformation function onto the given object, and to patch its status afterwards with optimistic locking. It retries the status patch with an exponential backoff.
func TryUpdate ¶
func TryUpdate(ctx context.Context, backoff wait.Backoff, c client.Client, obj client.Object, transform func() error) error
TryUpdate tries to apply the given transformation function onto the given object, and to update it afterwards. It retries the update with an exponential backoff.
func TryUpdateControllerInstallation ¶
func TryUpdateControllerInstallation(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.ControllerInstallation) (*gardencorev1beta1.ControllerInstallation, error)) (*gardencorev1beta1.ControllerInstallation, error)
TryUpdateControllerInstallation tries to update the status of the controllerInstallation matching the given <meta>. It retries with the given <backoff> characteristics as long as it gets Conflict errors. The transformation function is applied to the current state of the ControllerInstallation object. If the transformation yields a semantically equal ControllerInstallation, no update is done and the operation returns normally.
func TryUpdateControllerInstallationStatus ¶
func TryUpdateControllerInstallationStatus(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.ControllerInstallation) (*gardencorev1beta1.ControllerInstallation, error)) (*gardencorev1beta1.ControllerInstallation, error)
TryUpdateControllerInstallationStatus tries to update the status of the controllerInstallation matching the given <meta>. It retries with the given <backoff> characteristics as long as it gets Conflict errors. The transformation function is applied to the current state of the ControllerInstallation object. If the transformation yields a semantically equal ControllerInstallation, no update is done and the operation returns normally.
func TryUpdateControllerInstallationStatusWithEqualFunc ¶
func TryUpdateControllerInstallationStatusWithEqualFunc(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.ControllerInstallation) (*gardencorev1beta1.ControllerInstallation, error), equal func(cur, updated *gardencorev1beta1.ControllerInstallation) bool) (*gardencorev1beta1.ControllerInstallation, error)
TryUpdateControllerInstallationStatusWithEqualFunc tries to update the status of the controllerInstallation matching the given <meta>. It retries with the given <backoff> characteristics as long as it gets Conflict errors. The transformation function is applied to the current state of the ControllerInstallation object. If the equal func concludes a semantically equal ControllerInstallation, no update is done and the operation returns normally.
func TryUpdateControllerInstallationWithEqualFunc ¶
func TryUpdateControllerInstallationWithEqualFunc(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.ControllerInstallation) (*gardencorev1beta1.ControllerInstallation, error), equal func(cur, updated *gardencorev1beta1.ControllerInstallation) bool) (*gardencorev1beta1.ControllerInstallation, error)
TryUpdateControllerInstallationWithEqualFunc tries to update the status of the controllerInstallation matching the given <meta>. It retries with the given <backoff> characteristics as long as it gets Conflict errors. The transformation function is applied to the current state of the ControllerInstallation object. If the equal func concludes a semantically equal ControllerInstallation, no update is done and the operation returns normally.
func TryUpdateControllerRegistration ¶
func TryUpdateControllerRegistration(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.ControllerRegistration) (*gardencorev1beta1.ControllerRegistration, error)) (*gardencorev1beta1.ControllerRegistration, error)
TryUpdateControllerRegistration tries to update the status of the controllerRegistration matching the given <meta>. It retries with the given <backoff> characteristics as long as it gets Conflict errors. The transformation function is applied to the current state of the ControllerRegistration object. If the transformation yields a semantically equal ControllerRegistration, no update is done and the operation returns normally.
func TryUpdateControllerRegistrationWithEqualFunc ¶
func TryUpdateControllerRegistrationWithEqualFunc(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.ControllerRegistration) (*gardencorev1beta1.ControllerRegistration, error), equal func(cur, updated *gardencorev1beta1.ControllerRegistration) bool) (*gardencorev1beta1.ControllerRegistration, error)
TryUpdateControllerRegistrationWithEqualFunc tries to update the status of the controllerRegistration matching the given <meta>. It retries with the given <backoff> characteristics as long as it gets Conflict errors. The transformation function is applied to the current state of the ControllerRegistration object. If the equal func concludes a semantically equal ControllerRegistration, no update is done and the operation returns normally.
func TryUpdateNamespace ¶
func TryUpdateNamespace(ctx context.Context, k k8s.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*corev1.Namespace) (*corev1.Namespace, error)) (*corev1.Namespace, error)
TryUpdateNamespace tries to update a namespace and retries the operation with the given <backoff>.
func TryUpdateNamespaceLabels ¶
func TryUpdateNamespaceLabels(ctx context.Context, k k8s.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*corev1.Namespace) (*corev1.Namespace, error)) (*corev1.Namespace, error)
TryUpdateNamespaceLabels tries to update a namespace's labels and retries the operation with the given <backoff>.
func TryUpdateProject ¶
func TryUpdateProject(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.Project) (*gardencorev1beta1.Project, error)) (*gardencorev1beta1.Project, error)
TryUpdateProject tries to update a project and retries the operation with the given <backoff>.
func TryUpdateProjectStatus ¶
func TryUpdateProjectStatus(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.Project) (*gardencorev1beta1.Project, error)) (*gardencorev1beta1.Project, error)
TryUpdateProjectStatus tries to update a project's status and retries the operation with the given <backoff>.
func TryUpdateSeed ¶
func TryUpdateSeed(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.Seed) (*gardencorev1beta1.Seed, error)) (*gardencorev1beta1.Seed, error)
TryUpdateSeed tries to update the status of the seed matching the given <meta>. It retries with the given <backoff> characteristics as long as it gets Conflict errors. The transformation function is applied to the current state of the Seed object. If the transformation yields a semantically equal Seed, no update is done and the operation returns normally.
func TryUpdateSeedConditions ¶ added in v0.33.0
func TryUpdateSeedConditions(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.Seed) (*gardencorev1beta1.Seed, error)) (*gardencorev1beta1.Seed, error)
TryUpdateSeedConditions tries to update the status of the seed matching the given <meta>. It retries with the given <backoff> characteristics as long as it gets Conflict errors. The transformation function is applied to the current state of the Seed object. If the transformation yields a semantically equal Seed (regarding conditions), no update is done and the operation returns normally.
func TryUpdateSeedStatus ¶ added in v0.33.0
func TryUpdateSeedStatus(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.Seed) (*gardencorev1beta1.Seed, error)) (*gardencorev1beta1.Seed, error)
TryUpdateSeedStatus tries to update the status of the seed matching the given <meta>. It retries with the given <backoff> characteristics as long as it gets Conflict errors. The transformation function is applied to the current state of the Seed object. If the transformation yields a semantically equal Seed (regarding Status), no update is done and the operation returns normally.
func TryUpdateSeedWithEqualFunc ¶
func TryUpdateSeedWithEqualFunc(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.Seed) (*gardencorev1beta1.Seed, error), equal func(cur, updated *gardencorev1beta1.Seed) bool) (*gardencorev1beta1.Seed, error)
TryUpdateSeedWithEqualFunc tries to update the status of the seed matching the given <meta>. It retries with the given <backoff> characteristics as long as it gets Conflict errors. The transformation function is applied to the current state of the Seed object. If the equal func concludes a semantically equal Seed, no update is done and the operation returns normally.
func TryUpdateShoot ¶
func TryUpdateShoot(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.Shoot) (*gardencorev1beta1.Shoot, error)) (*gardencorev1beta1.Shoot, error)
TryUpdateShoot tries to update the shoot matching the given <meta>. It retries with the given <backoff> characteristics as long as it gets Conflict errors. The transformation function is applied to the current state of the Shoot object. If the transformation yields a semantically equal Shoot, no update is done and the operation returns normally.
func TryUpdateShootHibernation ¶
func TryUpdateShootHibernation(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.Shoot) (*gardencorev1beta1.Shoot, error)) (*gardencorev1beta1.Shoot, error)
TryUpdateShootHibernation tries to update the status of the shoot matching the given <meta>. It retries with the given <backoff> characteristics as long as it gets Conflict errors. The transformation function is applied to the current state of the Shoot object. If the transformation yields a semantically equal Shoot, no update is done and the operation returns normally.
func TryUpdateShootStatus ¶
func TryUpdateShootStatus(ctx context.Context, g gardencore.Interface, backoff wait.Backoff, meta metav1.ObjectMeta, transform func(*gardencorev1beta1.Shoot) (*gardencorev1beta1.Shoot, error)) (*gardencorev1beta1.Shoot, error)
TryUpdateShootStatus tries to update the status of the shoot matching the given <meta>. It retries with the given <backoff> characteristics as long as it gets Conflict errors. The transformation function is applied to the current state of the Shoot object. If the transformation yields a semantically equal Shoot (regarding Status), no update is done and the operation returns normally.
func TryUpdateStatus ¶
func TryUpdateStatus(ctx context.Context, backoff wait.Backoff, c client.Client, obj client.Object, transform func() error) error
TryUpdateStatus tries to apply the given transformation function onto the given object, and to update its status afterwards. It retries the status update with an exponential backoff.
func ValidDeploymentContainerImageVersion ¶
func ValidDeploymentContainerImageVersion(deploymentToCheck *appsv1.Deployment, containerName, minimumVersion string) (bool, error)
ValidDeploymentContainerImageVersion validates compliance of a deployment container image to a minimum version
func WaitUntilLoadBalancerIsReady ¶ added in v1.15.0
func WaitUntilLoadBalancerIsReady(ctx context.Context, kubeClient kubernetes.Interface, namespace, name string, timeout time.Duration, logger *logrus.Entry) (string, error)
WaitUntilLoadBalancerIsReady waits until the given external load balancer has been created (i.e., its ingress information has been updated in the service status).
func WaitUntilResourceDeleted ¶
func WaitUntilResourceDeleted(ctx context.Context, c client.Client, obj client.Object, interval time.Duration) error
WaitUntilResourceDeleted deletes the given resource and then waits until it has been deleted. It respects the given interval and timeout.
func WaitUntilResourceDeletedWithDefaults ¶
func WaitUntilResourceDeletedWithDefaults(ctx context.Context, c client.Client, obj client.Object) error
WaitUntilResourceDeletedWithDefaults deletes the given resource and then waits until it has been deleted. It uses a default interval and timeout
func WaitUntilResourcesDeleted ¶ added in v1.1.0
func WaitUntilResourcesDeleted(ctx context.Context, c client.Client, list client.ObjectList, interval time.Duration, opts ...client.ListOption) error
WaitUntilResourcesDeleted waits until the given resources are gone. It respects the given interval and timeout.
Types ¶
type DaemonSetLister ¶
type DaemonSetLister interface { // List lists all DaemonSets that match the given selector. List(selector labels.Selector) ([]*appsv1.DaemonSet, error) // DaemonSets yields a DaemonSetNamespaceLister for the given namespace. DaemonSets(namespace string) DaemonSetNamespaceLister }
DaemonSetLister is a lister of DaemonSets.
func NewDaemonSetLister ¶
func NewDaemonSetLister(source DaemonSetSource) DaemonSetLister
NewDaemonSetLister creates a new DaemonSetLister from the given DaemonSetSource.
type DaemonSetNamespaceLister ¶
type DaemonSetNamespaceLister interface { // List lists all DaemonSets that match the given selector in the current namespace. List(selector labels.Selector) ([]*appsv1.DaemonSet, error) // Get retrieves the DaemonSet with the given name in the current namespace. Get(name string) (*appsv1.DaemonSet, error) }
DaemonSetNamespaceLister is a lister of deployments for a specific namespace.
type DaemonSetSource ¶
DaemonSetSource is a function that produces a slice of DaemonSets or an error.
type DeploymentLister ¶
type DeploymentLister interface { // List lists all Deployments that match the given selector. List(selector labels.Selector) ([]*appsv1.Deployment, error) // Deployments yields a DeploymentNamespaceLister for the given namespace. Deployments(namespace string) DeploymentNamespaceLister }
DeploymentLister is a lister of Deployments.
func NewDeploymentLister ¶
func NewDeploymentLister(source DeploymentSource) DeploymentLister
NewDeploymentLister creates a new DeploymentLister from the given DeploymentSource.
type DeploymentNamespaceLister ¶
type DeploymentNamespaceLister interface { // List lists all Deployments that match the given selector in the current namespace. List(selector labels.Selector) ([]*appsv1.Deployment, error) // Get retrieves the Deployment with the given name in the current namespace. Get(name string) (*appsv1.Deployment, error) }
DeploymentNamespaceLister is a lister of deployments for a specific namespace.
type DeploymentSource ¶
type DeploymentSource func() ([]*appsv1.Deployment, error)
DeploymentSource is a function that produces a slice of Deployments or an error.
type EtcdLister ¶ added in v1.2.0
type EtcdLister interface { // List lists all Etcds that match the given selector. List(selector labels.Selector) ([]*druidv1alpha1.Etcd, error) // Etcds yields a EtcdNamespaceLister for the given namespace. Etcds(namespace string) EtcdNamespaceLister }
EtcdLister is a lister of Etcds.
func NewEtcdLister ¶ added in v1.2.0
func NewEtcdLister(source EtcdSource) EtcdLister
NewEtcdLister creates a new EtcdLister from the given EtcdSource.
type EtcdNamespaceLister ¶ added in v1.2.0
type EtcdNamespaceLister interface { // List lists all Etcds that match the given selector in the current namespace. List(selector labels.Selector) ([]*druidv1alpha1.Etcd, error) // Get retrieves the Etcd with the given name in the current namespace. Get(name string) (*druidv1alpha1.Etcd, error) }
EtcdNamespaceLister is a lister of etcds for a specific namespace.
type EtcdSource ¶ added in v1.2.0
type EtcdSource func() ([]*druidv1alpha1.Etcd, error)
EtcdSource is a function that produces a slice of Etcds or an error.
type SortBy ¶ added in v1.15.2
SortBy the type of a "less" function that defines the ordering of its object arguments.
func ByCreationTimestamp ¶ added in v1.15.2
func ByCreationTimestamp() SortBy
ByCreationTimestamp returns a comparison function for sorting by creation timestamp.
type StatefulSetLister ¶
type StatefulSetLister interface { // List lists all StatefulSets that match the given selector. List(selector labels.Selector) ([]*appsv1.StatefulSet, error) // StatefulSets yields a StatefulSetNamespaceLister for the given namespace. StatefulSets(namespace string) StatefulSetNamespaceLister }
StatefulSetLister is a lister of StatefulSets.
func NewStatefulSetLister ¶
func NewStatefulSetLister(source StatefulSetSource) StatefulSetLister
NewStatefulSetLister creates a new StatefulSetLister form the given StatefulSetSource.
type StatefulSetNamespaceLister ¶
type StatefulSetNamespaceLister interface { // List lists all StatefulSets that match the given selector in the current namespace. List(selector labels.Selector) ([]*appsv1.StatefulSet, error) // Get retrieves the StatefulSet with the given name in the current namespace. Get(name string) (*appsv1.StatefulSet, error) }
StatefulSetNamespaceLister is a lister of StatefulSets for a specific namespace.
type StatefulSetSource ¶
type StatefulSetSource func() ([]*appsv1.StatefulSet, error)
StatefulSetSource is a function that produces a slice of StatefulSets or an error.
type WorkerLister ¶ added in v0.34.0
type WorkerLister interface { // List lists all Workers that match the given selector in the current namespace. List(selector labels.Selector) ([]*extensionsv1alpha1.Worker, error) // Workers yields a WorkerNamespaceLister for the given namespace. Workers(namespace string) WorkerNamespaceLister }
WorkerLister is a lister of Workers for a specific namespace.
func NewWorkerLister ¶ added in v0.34.0
func NewWorkerLister(source WorkerSource) WorkerLister
NewWorkerLister creates a new WorkerLister from the given WorkerSource.
type WorkerNamespaceLister ¶ added in v0.34.0
type WorkerNamespaceLister interface { // List lists all Workers that match the given selector in the current namespace. List(selector labels.Selector) ([]*extensionsv1alpha1.Worker, error) // Get retrieves the MachineDeployment with the given name in the current namespace. Get(name string) (*extensionsv1alpha1.Worker, error) }
WorkerNamespaceLister is a lister of Workers for a specific namespace.
type WorkerSource ¶ added in v0.34.0
type WorkerSource func() ([]*extensionsv1alpha1.Worker, error)
WorkerSource is a function that produces a slice of Workers or an error.