util

package
v0.0.0-...-8ce0486 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0, MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultWaitTimeout = 60 * time.Second

Functions

func ClientsetForContext

func ClientsetForContext(kubeContext string) (*kubernetes.Clientset, *restclient.Config, error)

ClientsetForContext creates an official kubernetes client

func CopyDockerConfigToPod

func CopyDockerConfigToPod(pod *corev1.Pod, client *kubernetes.Clientset, config *rest.Config) error

func CreateKubeClient

func CreateKubeClient(kubeContext string) (client.Client, error)

CreateKubeClient creates a controller-runtime kubernetes client. This client is usually superior to the other, and is often preferred.

func EnsureImagePulled

func EnsureImagePulled(imageName string, cli client.APIClient, log logger.Logger) error

func ExecCommand

func ExecCommand(log logger.Logger, command string, args ...interface{}) error

func ExecInPod

func ExecInPod(
	client *kubernetes.Clientset,
	config *restclient.Config,
	pod *corev1.Pod,
	options *corev1.PodExecOptions,
	stdin io.Reader,
	stdout,
	stderr io.Writer,
) error

func GZipCompress

func GZipCompress(input []byte) ([]byte, error)

func HomeDir

func HomeDir() string

func SanitizeImageName

func SanitizeImageName(host, image, tag string) string

func WaitForContainer

func WaitForContainer(
	containerName string,
	cli client.APIClient,
	log logger.Logger,
) error

func WaitForDaemonSet

func WaitForDaemonSet(
	cl client.Client,
	name string,
	namespace string,
	log logger.Logger,
) error

func WaitForDaemonSet2

func WaitForDaemonSet2(
	cl client.Client,
	name string,
	namespace string,
	timeout time.Duration,
	log logger.Logger,
) error

func WaitForDeployment

func WaitForDeployment(
	cl client.Client,
	name string,
	namespace string,
	log logger.Logger,
) error

func WaitForDeployment2

func WaitForDeployment2(
	cl client.Client,
	name string,
	namespace string,
	timeout time.Duration,
	log logger.Logger,
) error

func WaitForPod

func WaitForPod(name, namespace string, client *kubernetes.Clientset, log logger.Logger) error

func WaitForStatefulSet

func WaitForStatefulSet(
	cl client.Client,
	name string,
	namespace string,
	log logger.Logger,
) error

func WaitForStatefulSet2

func WaitForStatefulSet2(
	cl client.Client,
	name string,
	namespace string,
	timeout time.Duration,
	log logger.Logger,
) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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