util

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrettyPatroni patroniFormat = "pretty"
	TSVPatroni    patroniFormat = "tsv"
	JSONPatroni   patroniFormat = "json"
	YAMLPatroni   patroniFormat = "yaml"
)
View Source
const (
	TextPGBackRest pgbackrestFormat = "text"
	JSONPGBackRest pgbackrestFormat = "json"
)
View Source
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
	LabelMonitoring = "app.kubernetes.io/name=postgres-operator-monitoring"
)
View Source
const (

	// RolePatroniLeader is the LabelRole that Patroni sets on the Pod that is
	// currently the leader.
	RolePatroniLeader = "master"

	// RolePostgresUser is the LabelRole applied to PostgreSQL user secrets.
	RolePostgresUser = "pguser"
)
View Source
const (

	// ContainerDatabase is the name of the container running PostgreSQL and
	// supporting tools: Patroni, pgBackRest, etc.
	ContainerDatabase = "database"
)
View Source
const (

	// DataPostgres is a LabelData value that indicates the object has PostgreSQL data.
	DataPostgres = "postgres"
)

Variables

This section is empty.

Functions

func Confirm added in v0.4.0

func Confirm(reader io.Reader, writer io.Writer) *bool

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 NewPodExecutor

func NewPodExecutor(config *rest.Config) (podExecutor, error)

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

func PostgresUserSecretLabels(clusterName string) string

PostgresUserSecretLabels provides labels for the Postgres user Secret

func PrimaryInstanceLabels

func PrimaryInstanceLabels(clusterName string) string

PrimaryInstanceLabels provides labels for a PostgreSQL cluster primary instance

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL