# Functions
CreateBackrestRepoSecrets creates the secrets required to manage the pgBackRest repo container.
CreateRMDataTask is a legacy method that was moved into this file.
CreateSecret create the secret, user, and primary secrets.
CreateUserSecret will create a new secret holding a user credential.
CurrentPrimaryUpdate prepares the needed data structures with the correct current primary value before passing them along to be patched into the current pgcluster CRD's annotations.
ExecPolicy execute a sql policy against a cluster.
GeneratedPasswordLength returns the value for what the length of a randomly generated password should be.
GeneratedPasswordValidUntilDays returns the value for the number of days that a password is valid for, which is used as part of PostgreSQL's VALID UNTIL directive on a user.
GenerateExporterSecretName returns the name of the secret that contains information around a monitoring user.
GenerateNodeAffinity creates a Kubernetes node affinity object suitable for storage on our custom resource.
GeneratePassword generates a password of a given length out of the acceptable ASCII characters suitable for a password.
GeneratePgBouncerConfigMapName generates the name of the configmap file associated with the pgBouncer Deployment.
GeneratePgBouncerSecretName returns the name of the secret that contains information around a pgBouncer deployment.
GeneratePgBouncerUsersFileBytes generates the byte string that is used by the pgBouncer secret to authenticate a user into pgBouncer that is acting as the pgBouncer "service user" (aka PgBouncerUser).
GetCustomLabels gets a list of the custom labels that a user set so they can be applied to any non-Postgres cluster instance objects.
GetGCSCredsFromBackrestRepoSecret retrieves the GCS credentials, i.e.
GetLabels ...
GetPasswordFromSecret will fetch the password from a user secret.
GetPolicySQL returns the SQL string from a policy.
GetPrimaryPod gets the Pod of the primary PostgreSQL instance.
GetS3CredsFromBackrestRepoSecret retrieves the AWS S3 credentials, i.e.
GetSecretPassword ...
GetStandardImageTag takes the current image name and the image tag value stored in the pgcluster CRD and, if the image being used is the radondb-postgres-gis-ha container with the corresponding tag, it returns the tag without the addition of the GIS version.
GetTolerations returns any tolerations that may be defined in a tolerations in JSON format.
GetValueOrDefault checks whether the first value given is set.
IsPostgreSQLUserSystemAccount determines whether or not this is a system PostgreSQL user account, as if this returns true, one likely may not want to allow a user to directly access the account Normalizes the lookup by downcasing it.
IsStringOneOf tests to see string testVal is included in the list of strings provided using acceptedVals.
NewPrivatePublicKeyPair generates a an ed25519 ssh private and public key.
PatchClusterCRD patches the pgcluster CRD with any updated labels, or an updated current primary annotation value.
RandStringBytesRmndr ...
ReplicationStatus is responsible for retrieving and returning the replication information about the status of the replicas in a PostgreSQL cluster.
SetPostgreSQLPassword updates the password for a PostgreSQL role in the PostgreSQL cluster by executing into the primary Pod and changing it
Note: it is recommended to pre-hash the password (e.g.
SQLQuoteIdentifier quotes an "identifier" (e.g.
SQLQuoteLiteral quotes a 'literal' (e.g.
StopPostgreSQLInstance issues a "fast" shutdown command to the PostgreSQL instance.
ToggleAutoFailover enables or disables autofailover for a cluster.
UpdateUserSecret updates a user secret with a new password.
ValidateLabels validates if the input is a valid Kubernetes label.
ValidatePolicy tests to see if a policy exists.
ValidatePVCResize ensures that the quantities being used in a PVC resize are valid, and the resize is moving in an increasing direction.
# Constants
No description provided by the author
No description provided by the author
three of these are exported, as they are used to help add the information into the templates.
#nosec: G101.
#nosec: G101.
#nosec: G101.
#nosec: G101.
No description provided by the author
BootstrapConfigPrefix is the format of the prefix used for the Secret containing the pgBackRest configuration required to bootstrap a new cluster using a pgBackRest backup.
DefaultGeneratedPasswordLength is the length of what a generated password is if it's not set in the pgo.yaml file, and to create some semblance of consistency.
DefaultPasswordValidUntilDays is the number of days until a PostgreSQL user's password expires.
InstanceRolePrimary indicates that an instance is a primary.
InstanceRoleReplica indicates that an instance is a replica.
SQLValidUntilAlways uses a special PostgreSQL value to ensure a password is always valid.
SQLValidUntilNever uses a special PostgreSQL value to ensure a password is never valid.
# Variables
ErrLabelInvalid indicates that a label is invalid.
ErrMissingConfigAnnotation represents an error thrown when the 'config' annotation is found to be missing from the 'config' configMap created to store cluster-wide configuration.
# Structs
AWSS3Secret is a structured representation for providing an AWS S3 key and key secret.
BackrestRepoConfig represents the configuration required to created backrest repo secrets.
GCSSecret is a structured representation for providing the GCS key.
InstanceReplicationInfo is the user friendly information for the current status of key replication metrics for a PostgreSQL instance.
No description provided by the author
No description provided by the author
SSHKey stores byte slices that represent private and public ssh keys.