Documentation
¶
Overview ¶
Package external contains the functions needed to manage servers which are external to this PostgreSQL cluster
Index ¶
- func ConfigureConnectionToServer(ctx context.Context, client ctrl.Client, namespace string, ...) (string, string, error)
- func CreatePgPassFile(serverName, password string) (string, error)
- func DumpSecretKeyRefToFile(ctx context.Context, client ctrl.Client, namespace string, serverName string, ...) (string, error)
- func ReadSecretKeyRef(ctx context.Context, client ctrl.Client, namespace string, ...) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureConnectionToServer ¶
func ConfigureConnectionToServer( ctx context.Context, client ctrl.Client, namespace string, server *apiv1.ExternalCluster, ) (string, string, error)
ConfigureConnectionToServer creates a connection string to the external server, using the configuration inside the cluster and dumping the secret when needed. This function will return a connection string, the name of the pgpass file to be used, and an error state
func CreatePgPassFile ¶
CreatePgPassFile creates a pgpass file inside the user home directory
func DumpSecretKeyRefToFile ¶
func DumpSecretKeyRefToFile( ctx context.Context, client ctrl.Client, namespace string, serverName string, selector *corev1.SecretKeySelector, ) (string, error)
DumpSecretKeyRefToFile dumps a certain secret to a file inside a temporary folder using 0600 as permission bits.
This function overlaps with the Kubernetes ability to mount a secret in a pod, with the difference that we can change the attached secret without restarting the pod. We also need to have more control over when the secret content is updated.
Types ¶
This section is empty.