pgupgrade

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PostHookScriptFileName = "posthook.sh"
	PrepareScriptFileName  = "prepare.sh"
)
View Source
const (
	DefaultPostgresInitDBUser = "postgres"
)

Variables

This section is empty.

Functions

func AutoDiscoverPostgresVersionFromImage

func AutoDiscoverPostgresVersionFromImage(image string) (string, error)

func RetryAllErrorsFn

func RetryAllErrorsFn(ctx context.Context) func(err error) bool

func RunPGDataMigration

func RunPGDataMigration(ctx context.Context, k8sClient *kubernetes.Clientset, namespace, sourcePersistenVolumeName, targetPVCName, storageClassName string, newSize string, jobaction JobActions) error

func Truncate

func Truncate(s string, n int) string

Truncate returns the first n runes of s.

Types

type JobActions

type JobActions struct {
	Name              string
	Script            string
	PostHookScript    string
	JobContainer      v1.Container
	PrepareContainer  v1.Container
	PostHookContainer v1.Container
}

type PGUpgradeRunner

type PGUpgradeRunner struct {
	// contains filtered or unexported fields
}

func NewPGUpgradeRunner

func NewPGUpgradeRunner(namespace string, settings PGUpgradeSettings) (*PGUpgradeRunner, error)

func (*PGUpgradeRunner) RunPGUpgradeForDatabasePVC

func (r *PGUpgradeRunner) RunPGUpgradeForDatabasePVC(ctx context.Context) error

func (*PGUpgradeRunner) RunPGUpgradeForDatabaseStatefulSet

func (r *PGUpgradeRunner) RunPGUpgradeForDatabaseStatefulSet(ctx context.Context, targetStatefulSetName string) error

type PGUpgradeSettings

type PGUpgradeSettings struct {
	UpgradeImage string

	InitDBArgs string
	DiskSize   string

	CurrentPostgresVersion string
	TargetPostgresVersion  string
	PostgresContainerName  string

	PVCName    string
	InitDBUser string

	SourcePVCName string
	TargetPVCName string
	SubPath       string
}

func (*PGUpgradeSettings) GetInitDBUser

func (s *PGUpgradeSettings) GetInitDBUser() string

func (*PGUpgradeSettings) GetUpgradeImage

func (s *PGUpgradeSettings) GetUpgradeImage() string

func (*PGUpgradeSettings) Validate

func (s *PGUpgradeSettings) Validate() error

Jump to

Keyboard shortcuts

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