Skip to content

Commit 01706a6

Browse files
authored
chore: decouples from the instance struct (cloudnative-pg#933)
Closes cloudnative-pg#932 Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
1 parent cc8d54c commit 01706a6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/management/postgres/instance.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ func (instance *Instance) Rewind(postgresMajorVersion int) error {
794794
}
795795

796796
// PgIsReady gets the status from the pg_isready command
797-
func (instance *Instance) PgIsReady() error {
797+
func PgIsReady() error {
798798
// We just use the environment variables we already have
799799
// to pass the connection parameters
800800
options := []string{
@@ -805,7 +805,7 @@ func (instance *Instance) PgIsReady() error {
805805

806806
// Run `pg_isready` which returns 0 if everything is OK.
807807
// It returns 1 when PostgreSQL is not ready to accept
808-
// connections but it is starting up (this is a valid
808+
// connections but, it is starting up (this is a valid
809809
// condition for example for a standby that is fetching
810810
// WAL files and trying to reach a consistent state).
811811
cmd := exec.Command(pgIsReady, options...) // #nosec G204

pkg/management/postgres/probes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737

3838
// IsServerHealthy check if the instance is healthy
3939
func (instance *Instance) IsServerHealthy() error {
40-
err := instance.PgIsReady()
40+
err := PgIsReady()
4141

4242
// A healthy server can also be actively rejecting connections.
4343
// That's not a problem: it's only the server starting up or shutting

0 commit comments

Comments
 (0)