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
( ctx context.Context, crudClient client.Client, kubeInterface kubernetes.Interface, restConfig *rest.Config, podLocator PodLocator, dbname DatabaseName, query string, timeout time.Duration, )
| 116 | // QueryInInstancePodWithTimeout executes a query in an instance pod, by connecting to the pod |
| 117 | // and the postgres container, and using a local connection with the postgres user |
| 118 | func QueryInInstancePodWithTimeout( |
| 119 | ctx context.Context, |
| 120 | crudClient client.Client, |
| 121 | kubeInterface kubernetes.Interface, |
| 122 | restConfig *rest.Config, |
| 123 | podLocator PodLocator, |
| 124 | dbname DatabaseName, |
| 125 | query string, |
| 126 | timeout time.Duration, |
| 127 | ) (string, string, error) { |
| 128 | return CommandInInstancePod( |
| 129 | ctx, crudClient, kubeInterface, restConfig, |
| 130 | PodLocator{ |
| 131 | Namespace: podLocator.Namespace, |
| 132 | PodName: podLocator.PodName, |
| 133 | }, &timeout, "psql", "-U", "postgres", string(dbname), "-tAc", query) |
| 134 | } |
| 135 | |
| 136 | // EventuallyExecQueryInInstancePod wraps QueryInInstancePod with an Eventually clause |
| 137 | func EventuallyExecQueryInInstancePod( |
no test coverage detected