GetPGControlData obtains the PgControldata from the passed pod by doing an exec. This approach should be used only in the plugin commands.
( ctx context.Context, pod corev1.Pod, )
| 151 | // GetPGControlData obtains the PgControldata from the passed pod by doing an exec. |
| 152 | // This approach should be used only in the plugin commands. |
| 153 | func GetPGControlData( |
| 154 | ctx context.Context, |
| 155 | pod corev1.Pod, |
| 156 | ) (string, error) { |
| 157 | timeout := time.Second * 10 |
| 158 | clientInterface := kubernetes.NewForConfigOrDie(Config) |
| 159 | stdout, _, err := utils.ExecCommand( |
| 160 | ctx, |
| 161 | clientInterface, |
| 162 | Config, |
| 163 | pod, |
| 164 | specs.PostgresContainerName, |
| 165 | &timeout, |
| 166 | "pg_controldata") |
| 167 | if err != nil { |
| 168 | return "", err |
| 169 | } |
| 170 | |
| 171 | return stdout, nil |
| 172 | } |
| 173 | |
| 174 | // completeClusters is mainly used inside the unit tests |
| 175 | func completeClusters( |
nothing calls this directly
no test coverage detected