Skip to content

Commit

Permalink
refactor: remove pg health check
Browse files Browse the repository at this point in the history
Signed-off-by: zhuhuijun <zhuhuijunzhj@gmail.com>
  • Loading branch information
Ghostbaby authored and bitsf committed Mar 2, 2021
1 parent eb5d993 commit 6be5508
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 83 deletions.
65 changes: 0 additions & 65 deletions pkg/cluster/controllers/database/healthchecker.go

This file was deleted.

4 changes: 0 additions & 4 deletions pkg/cluster/controllers/database/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ type Connect struct {
Database string
}

func (p *PostgreSQLController) HealthChecker() lcm.HealthChecker {
return &PostgreSQLHealthChecker{}
}

func (p *PostgreSQLController) Apply(ctx context.Context, harborcluster *goharborv1alpha2.HarborCluster) (*lcm.CRStatus, error) {
p.DClient.WithContext(ctx)
p.Client.WithContext(ctx)
Expand Down
17 changes: 3 additions & 14 deletions pkg/cluster/controllers/database/readiness.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,17 @@ const (
// - return postgre properties if postgre has available.
func (p *PostgreSQLController) Readiness(ctx context.Context) (*lcm.CRStatus, error) {
var (
conn *Connect
client *pgx.Conn
err error
conn *Connect
err error
)

name := p.HarborCluster.Name

conn, client, err = p.GetInClusterDatabaseInfo(ctx)
conn, _, err = p.GetInClusterDatabaseInfo(ctx)
if err != nil {
return nil, err
}

defer client.Close(ctx)

if err := client.Ping(ctx); err != nil {
p.Log.Error(err, "Fail to check Database.",
"namespace", p.HarborCluster.Namespace,
"name", p.HarborCluster.Name)

return nil, err
}

p.Log.Info("Database already ready.",
"namespace", p.HarborCluster.Namespace,
"name", p.HarborCluster.Name)
Expand Down

0 comments on commit 6be5508

Please sign in to comment.