exec

package
v1.25.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package exec provides functions to execute commands inside pods or from local

Index

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

type ContainerLocator struct {
	Namespace     string
	PodName       string
	ContainerName string
}

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

type PodLocator struct {
	Namespace string
	PodName   string
}

PodLocator contains the necessary data to find a pod

Jump to

Keyboard shortcuts

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