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 ¶
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
type BackupClient interface {
StatusWithErrors(ctx context.Context, pod *corev1.Pod) (*webserver.Response[webserver.BackupResultData], error)
Start(
ctx context.Context,
pod *corev1.Pod,
sbq webserver.StartBackupRequest,
) (*webserver.Response[webserver.BackupResultData], error)
Stop(
ctx context.Context,
pod *corev1.Pod,
sbq webserver.StopBackupRequest,
) (*webserver.Response[webserver.BackupResultData], error)
}
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
type HTTPScheme ¶
type HTTPScheme string
HTTPScheme identifies a valid scheme: http, https
func GetStatusSchemeFromPod ¶
func GetStatusSchemeFromPod(pod *corev1.Pod) HTTPScheme
GetStatusSchemeFromPod detects if a Pod is exposing the status via HTTP or HTTPS
func (HTTPScheme) ToString ¶
func (h HTTPScheme) ToString() string
ToString returns the scheme as a string value
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 ¶
An StatusError reports an unsuccessful attempt to retrieve an instance status
func (StatusError) Error ¶
func (i StatusError) Error() string