remote

package
v1.31.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 22 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package remote contains the client capable of querying the webserver remote endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTransientAuthError added in v1.30.0

func IsTransientAuthError(err error) bool

IsTransientAuthError reports whether err is a transient instance manager rejection of the operator's client certificate. The instance manager replies 503 while it does not (yet) recognize the presented certificate — either no operator fingerprint has been registered in the cluster status, or the cached fingerprint does not match it yet. This resolves as the operator certificate fingerprint propagates to the instance's cached cluster (for example right after an operator restart), so the caller should retry.

A 401 (no usable client certificate, e.g. a status port not served over TLS) is NOT transient and is intentionally excluded: the caller should fail rather than retry.

Types

type BackupClient added in v1.25.2

BackupClient is the interface to interact with the backup endpoints

type Client

type Client interface {
	Instance() InstanceClient
	Backup() BackupClient
}

Client is the interface to interact with the remote webserver

func NewClient

func NewClient() Client

NewClient creates a new remote client

type InstanceClient

type InstanceClient interface {
	// GetStatusFromInstances gets the replication status from the PostgreSQL instances,
	// the returned list is sorted in order to have the primary as the first element
	// and the other instances in their election order
	GetStatusFromInstances(
		ctx context.Context,
		pods corev1.PodList,
	) postgres.PostgresqlStatusList

	// GetPgControlDataFromInstance obtains the pg_controldata from the instance HTTP endpoint
	GetPgControlDataFromInstance(
		ctx context.Context,
		pod *corev1.Pod,
	) (string, error)

	// UpgradeInstanceManager upgrades the instance manager to the passed availableArchitecture
	UpgradeInstanceManager(
		ctx context.Context,
		pod *corev1.Pod,
		availableArchitecture *utils.AvailableArchitecture,
	) error

	// ArchivePartialWAL trigger the archiver for the latest partial WAL
	// file created in a specific Pod
	ArchivePartialWAL(context.Context, *corev1.Pod) (string, error)
}

InstanceClient a http client capable of querying the instance HTTP endpoints

type StatusError

type StatusError struct {
	StatusCode int
	Body       string
}

An StatusError reports an unsuccessful attempt to retrieve an instance status

func (StatusError) Error

func (i StatusError) Error() string

Jump to

Keyboard shortcuts

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