Skip to content

Commit

Permalink
Add pgpool db client
Browse files Browse the repository at this point in the history
Signed-off-by: MobarakHsn <[email protected]>
  • Loading branch information
MobarakHsn committed Jan 18, 2024
1 parent 63f2127 commit 3fd840d
Show file tree
Hide file tree
Showing 87 changed files with 2,049 additions and 1,762 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ require (
k8s.io/apimachinery v0.29.0
k8s.io/klog/v2 v2.110.1
kmodules.xyz/client-go v0.29.6
kubedb.dev/apimachinery v0.41.0-beta.0.0.20240117131030-72d44aef7411
kmodules.xyz/custom-resources v0.29.0
kubedb.dev/apimachinery v0.41.0-beta.0.0.20240118063916-9d6870498d68
sigs.k8s.io/controller-runtime v0.16.3
xorm.io/xorm v1.3.6
)
Expand Down Expand Up @@ -115,7 +116,6 @@ require (
k8s.io/kube-openapi v0.0.0-20231129212854-f0671cc7e66a // indirect
k8s.io/utils v0.0.0-20231127182322-b307cd553661 // indirect
kmodules.xyz/apiversion v0.2.0 // indirect
kmodules.xyz/custom-resources v0.29.0 // indirect
kmodules.xyz/monitoring-agent-api v0.29.0 // indirect
kmodules.xyz/offshoot-api v0.29.0 // indirect
modernc.org/memory v1.5.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,8 @@ kmodules.xyz/monitoring-agent-api v0.29.0 h1:gpFl6OZrlMLb/ySMHdREI9EwGtnJ91oZBn9
kmodules.xyz/monitoring-agent-api v0.29.0/go.mod h1:iNbvaMTgVFOI5q2LJtGK91j4Dmjv4ZRiRdasGmWLKQI=
kmodules.xyz/offshoot-api v0.29.0 h1:GHLhxxT9jU1N8+FvOCCeJNyU5g0duYS46UGrs6AHNLY=
kmodules.xyz/offshoot-api v0.29.0/go.mod h1:5NxhBblXoDHWStx9HCDJR2KFTwYjEZ7i1Id3jelIunw=
kubedb.dev/apimachinery v0.41.0-beta.0.0.20240117131030-72d44aef7411 h1:ZSVihIHPJfZSoegK5WGpSsVPTDZzHuaLsqOK9Hp+6Xg=
kubedb.dev/apimachinery v0.41.0-beta.0.0.20240117131030-72d44aef7411/go.mod h1:9iHsSfX02yJ6eA9IXSCruVjckH8wWgHB93ivpNVc1EY=
kubedb.dev/apimachinery v0.41.0-beta.0.0.20240118063916-9d6870498d68 h1:2J1DMU9OiiMzQMKfv+gTGkmcN34JTARqS5CA0pjctMc=
kubedb.dev/apimachinery v0.41.0-beta.0.0.20240118063916-9d6870498d68/go.mod h1:9iHsSfX02yJ6eA9IXSCruVjckH8wWgHB93ivpNVc1EY=
lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI=
lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
Expand Down
2 changes: 1 addition & 1 deletion pgpool/kubedb_client_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"database/sql"
"fmt"

_ "github.com/lib/pq"
core "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -154,7 +155,6 @@ func (o *KubeDBClientBuilder) getPgpoolAuthCredentials() (string, string, error)
return "", "", fmt.Errorf("DB root user is not set")
}
pass, ok := secret.Data[core.BasicAuthPasswordKey]
fmt.Println("Here is the password used in pgpool: ", string(pass))
if !ok {
return "", "", fmt.Errorf("DB root password is not set")
}
Expand Down
2 changes: 0 additions & 2 deletions postgres/kubedb_client_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ func (o *KubeDBClientBuilder) getPostgresAuthCredentials() (string, string, erro
if err != nil {
return "", "", err
}
pass := string(secret.Data[core.BasicAuthPasswordKey])
fmt.Println("Here is the password used in postgres: ", pass)
return string(secret.Data[core.BasicAuthUsernameKey]), string(secret.Data[core.BasicAuthPasswordKey]), nil
}

Expand Down
7 changes: 7 additions & 0 deletions vendor/github.com/go-sql-driver/mysql/AUTHORS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/go-sql-driver/mysql/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions vendor/github.com/go-sql-driver/mysql/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions vendor/github.com/go-sql-driver/mysql/atomic_bool.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions vendor/github.com/go-sql-driver/mysql/atomic_bool_go118.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 34 additions & 22 deletions vendor/github.com/go-sql-driver/mysql/auth.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/github.com/go-sql-driver/mysql/collations.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/github.com/go-sql-driver/mysql/conncheck.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/github.com/go-sql-driver/mysql/conncheck_dummy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3fd840d

Please sign in to comment.