apiclient

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdateConfigMap

func CreateOrUpdateConfigMap(client clientset.Interface, cm *v1.ConfigMap) error

CreateOrUpdateConfigMap creates a ConfigMap if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.

func CreateOrUpdateRole

func CreateOrUpdateRole(client clientset.Interface, role *rbac.Role) error

CreateOrUpdateRole creates a Role if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.

func CreateOrUpdateRoleBinding

func CreateOrUpdateRoleBinding(client clientset.Interface, roleBinding *rbac.RoleBinding) error

CreateOrUpdateRoleBinding creates a RoleBinding if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.

func CreateOrUpdateSecret

func CreateOrUpdateSecret(client clientset.Interface, secret *v1.Secret) error

CreateOrUpdateSecret creates a Secret if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.

func GetConfigMapWithRetry

func GetConfigMapWithRetry(client clientset.Interface, namespace, name string) (*v1.ConfigMap, error)

GetConfigMapWithRetry tries to retrieve a ConfigMap using the given client, retrying if we get an unexpected error.

TODO: evaluate if this can be done better. Potentially remove the retry if feasible.

func GetNodePoolInfoWithRetry added in v1.4.0

func GetNodePoolInfoWithRetry(cfg *clientcmdapi.Config, name string) (*v1beta1.NodePool, error)

func TryRunCommand

func TryRunCommand(f func() error, failureThreshold int) error

TryRunCommand runs a function a maximum of failureThreshold times, and retries on error. If failureThreshold is hit; the last error is returned

Types

type ConfigMapMutator

type ConfigMapMutator func(*v1.ConfigMap) error

ConfigMapMutator is a function that mutates the given ConfigMap and optionally returns an error

Jump to

Keyboard shortcuts

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