Documentation
¶
Index ¶
- Constants
- func Confirm(reader io.Reader, writer io.Writer) *bool
- func DBInstanceLabels(clusterName string) string
- func NewPodExecutor(config *rest.Config) (podExecutor, error)
- func PostgresUserSecretLabels(clusterName string) string
- func PrimaryInstanceLabels(clusterName string) string
- func RepoHostInstanceLabels(clusterName string) string
Constants ¶
const ( PrettyPatroni patroniFormat = "pretty" TSVPatroni patroniFormat = "tsv" JSONPatroni patroniFormat = "json" YAMLPatroni patroniFormat = "yaml" )
const ( TextPGBackRest pgbackrestFormat = "text" JSONPGBackRest pgbackrestFormat = "json" )
const ( // LabelCluster is used to label PostgresCluster objects. LabelCluster = labelPrefix + "cluster" // LabelData is used to identify Pods and Volumes store Postgres data. LabelData = labelPrefix + "data" // LabelRole is used to identify object roles. LabelRole = labelPrefix + "role" // LabelMonitoring is used to identify monitoring Pods. // Older versions of PGO monitoring use the label 'postgres-operator-monitoring'. LabelMonitoring = "app.kubernetes.io/name in (postgres-operator-monitoring,crunchy-monitoring)" // LabelOperator is used to identify operator Pods LabelOperator = "postgres-operator.crunchydata.com/control-plane" // LabelPGBackRestDedicated is used to identify the Repo Host pod LabelPGBackRestDedicated = labelPrefix + "pgbackrest-dedicated" )
const ( // DataPostgres is a LabelData value that indicates the object has PostgreSQL data. DataPostgres = "postgres" // DataBackrest is a LabelData value that indicate the object is a Repo Host. DataBackrest = "pgbackrest" )
const ( // RolePatroniLeader is the LabelRole that Patroni sets on the Pod that is // currently the leader. RolePatroniLeader = "master" // RolePatroniReplica is the LabelRole that Patroni sets on the Pod that is // currently a replica. RolePatroniReplica = "replica" // RolePostgresUser is the LabelRole applied to PostgreSQL user secrets. RolePostgresUser = "pguser" )
const ( // ContainerDatabase is the name of the container running PostgreSQL and // supporting tools: Patroni, pgBackRest, etc. ContainerDatabase = "database" ContainerPGBackrest = "pgbackrest" )
Variables ¶
This section is empty.
Functions ¶
func Confirm ¶ added in v0.4.0
Confirm uses a Scanner to parse user input. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations and return 'true'. Similarly, "n", "N", "no", "No", "NO" all deny confirmation and return 'false'. If the input is not recognized, nil is returned.
func DBInstanceLabels ¶ added in v0.5.0
DBInstanceLabels provides labels for a PostgreSQL cluster primary or replica instance
func NewPodExecutor ¶
NewPodExecutor returns an executor function. It is used when commands are run from a Container shell using an 'exec' command. The RBAC settings required for this are "resources=pods/exec,verbs=create"
func PostgresUserSecretLabels ¶ added in v0.4.0
PostgresUserSecretLabels provides labels for the Postgres user Secret
func PrimaryInstanceLabels ¶
PrimaryInstanceLabels provides labels for a PostgreSQL cluster primary instance
func RepoHostInstanceLabels ¶ added in v0.5.0
RepoHostInstanceLabels provides labels for a Backrest Repo Host instances
Types ¶
This section is empty.