Documentation
¶
Index ¶
- Constants
- func CreateOrUpdateEndpoints(ctx context.Context, eclient clientv1.EndpointsInterface, eps *v1.Endpoints) error
- func CreateOrUpdateSecret(ctx context.Context, secretClient clientv1.SecretInterface, desired *v1.Secret) error
- func CreateOrUpdateService(ctx context.Context, sclient clientv1.ServiceInterface, svc *v1.Service) error
- func GetMinorVersion(dclient discovery.DiscoveryInterface) (int, error)
- func IsAPIGroupVersionResourceSupported(discoveryCli discovery.DiscoveryInterface, groupversion string, ...) (bool, error)
- func IsResourceNotFoundError(err error) bool
- func LabelSelectionHasChanged(old, current map[string]string, selector *metav1.LabelSelector) (bool, error)
- func MergePatchContainers(base, patches []v1.Container) ([]v1.Container, error)
- func MustRegisterClientGoMetrics(registerer prometheus.Registerer)
- func NewClusterConfig(host string, tlsInsecure bool, tlsConfig *rest.TLSClientConfig) (*rest.Config, error)
- func PodRunningAndReady(pod v1.Pod) (bool, error)
- func SanitizeVolumeName(name string) string
- func UpdateStatefulSet(ctx context.Context, sstClient clientappsv1.StatefulSetInterface, ...) error
Constants ¶
const KubeConfigEnv = "KUBECONFIG"
KubeConfigEnv (optionally) specify the location of kubeconfig file
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdateEndpoints ¶ added in v0.6.0
func CreateOrUpdateSecret ¶ added in v0.48.0
func CreateOrUpdateSecret(ctx context.Context, secretClient clientv1.SecretInterface, desired *v1.Secret) error
CreateOrUpdateSecret merges metadata of existing Secret with new one and updates it.
func CreateOrUpdateService ¶ added in v0.6.0
func GetMinorVersion ¶ added in v0.12.0
func GetMinorVersion(dclient discovery.DiscoveryInterface) (int, error)
GetMinorVersion returns the minor version as an integer
func IsAPIGroupVersionResourceSupported ¶ added in v0.55.0
func IsAPIGroupVersionResourceSupported(discoveryCli discovery.DiscoveryInterface, groupversion string, resource string) (bool, error)
IsAPIGroupVersionResourceSupported checks if given groupVersion and resource is supported by the cluster.
you can exec `kubectl api-resources` to find groupVersion and resource.
func IsResourceNotFoundError ¶
func LabelSelectionHasChanged ¶ added in v0.48.0
func LabelSelectionHasChanged(old, current map[string]string, selector *metav1.LabelSelector) (bool, error)
LabelSelectionHasChanged returns true if the selector doesn't yield the same results for the old and current labels.
func MergePatchContainers ¶ added in v0.42.0
MergePatchContainers adds patches to base using a strategic merge patch and iterating by container name, failing on the first error
func MustRegisterClientGoMetrics ¶ added in v0.42.0
func MustRegisterClientGoMetrics(registerer prometheus.Registerer)
MustRegisterClientGoMetrics registers k8s.io/client-go metrics. It panics if it encounters an error (e.g. metrics already registered).
func NewClusterConfig ¶
func PodRunningAndReady ¶
PodRunningAndReady returns whether a pod is running and each container has passed it's ready state.
func SanitizeVolumeName ¶ added in v0.24.0
SanitizeVolumeName ensures that the given volume name is a valid DNS-1123 label accepted by Kubernetes.
func UpdateStatefulSet ¶ added in v0.46.0
func UpdateStatefulSet(ctx context.Context, sstClient clientappsv1.StatefulSetInterface, sset *appsv1.StatefulSet) error
UpdateStatefulSet merges metadata of existing StatefulSet with new one and updates it.
Types ¶
This section is empty.