Documentation
¶
Overview ¶
Package exec provides functions to execute commands inside pods or from local
Index ¶
- func Command(ctx context.Context, kubeInterface kubernetes.Interface, ...) (string, string, error)
- func CommandInContainer(ctx context.Context, crudClient client.Client, ...) (string, string, error)
- func CommandInInstancePod(ctx context.Context, crudClient client.Client, ...) (string, string, error)
- func EventuallyExecQueryInInstancePod(ctx context.Context, crudClient client.Client, ...) (string, string, error)
- func QueryInInstancePod(ctx context.Context, crudClient client.Client, ...) (string, string, error)
- func QueryInInstancePodWithTimeout(ctx context.Context, crudClient client.Client, ...) (string, string, error)
- type ContainerLocator
- type DatabaseName
- type PodLocator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Command ¶
func Command( ctx context.Context, kubeInterface kubernetes.Interface, restConfig *rest.Config, pod v1.Pod, containerName string, timeout *time.Duration, command ...string, ) (string, string, error)
Command wraps the utils.ExecCommand pre-setting values constant during tests
func CommandInContainer ¶
func CommandInContainer( ctx context.Context, crudClient client.Client, kubeInterface kubernetes.Interface, restConfig *rest.Config, container ContainerLocator, timeout *time.Duration, command ...string, ) (string, string, error)
CommandInContainer executes commands in a given instance pod, in the postgres container
func CommandInInstancePod ¶
func CommandInInstancePod( ctx context.Context, crudClient client.Client, kubeInterface kubernetes.Interface, restConfig *rest.Config, podLocator PodLocator, timeout *time.Duration, command ...string, ) (string, string, error)
CommandInInstancePod executes commands in a given instance pod, in the postgres container
func EventuallyExecQueryInInstancePod ¶
func EventuallyExecQueryInInstancePod( ctx context.Context, crudClient client.Client, kubeInterface kubernetes.Interface, restConfig *rest.Config, podLocator PodLocator, dbname DatabaseName, query string, retryTimeout int, pollingTime int, ) (string, string, error)
EventuallyExecQueryInInstancePod wraps QueryInInstancePod with an Eventually clause
func QueryInInstancePod ¶
func QueryInInstancePod( ctx context.Context, crudClient client.Client, kubeInterface kubernetes.Interface, restConfig *rest.Config, podLocator PodLocator, dbname DatabaseName, query string, ) (string, string, error)
QueryInInstancePod executes a query in an instance pod, by connecting to the pod and the postgres container, and using a local connection with the postgres user
func QueryInInstancePodWithTimeout ¶
func QueryInInstancePodWithTimeout( ctx context.Context, crudClient client.Client, kubeInterface kubernetes.Interface, restConfig *rest.Config, podLocator PodLocator, dbname DatabaseName, query string, timeout time.Duration, ) (string, string, error)
QueryInInstancePodWithTimeout executes a query in an instance pod, by connecting to the pod and the postgres container, and using a local connection with the postgres user
Types ¶
type ContainerLocator ¶
ContainerLocator contains the necessary data to find a container on a pod
type DatabaseName ¶
type DatabaseName string
DatabaseName is a special type for the database argument in an Exec call
type PodLocator ¶
PodLocator contains the necessary data to find a pod