MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / CommandInInstancePod

Function CommandInInstancePod

tests/utils/exec/exec.go:80–96  ·  view source on GitHub ↗

CommandInInstancePod executes commands in a given instance pod, in the postgres container

(
	ctx context.Context,
	crudClient client.Client,
	kubeInterface kubernetes.Interface,
	restConfig *rest.Config,
	podLocator PodLocator,
	timeout *time.Duration,
	command ...string,
)

Source from the content-addressed store, hash-verified

78// CommandInInstancePod executes commands in a given instance pod, in the
79// postgres container
80func CommandInInstancePod(
81 ctx context.Context,
82 crudClient client.Client,
83 kubeInterface kubernetes.Interface,
84 restConfig *rest.Config,
85 podLocator PodLocator,
86 timeout *time.Duration,
87 command ...string,
88) (string, string, error) {
89 return CommandInContainer(
90 ctx, crudClient, kubeInterface, restConfig,
91 ContainerLocator{
92 Namespace: podLocator.Namespace,
93 PodName: podLocator.PodName,
94 ContainerName: specs.PostgresContainerName,
95 }, timeout, command...)
96}
97
98// DatabaseName is a special type for the database argument in an Exec call
99type DatabaseName string

Calls 1

CommandInContainerFunction · 0.85