Skip to content

Commit

Permalink
recognize xormClient With the podName
Browse files Browse the repository at this point in the history
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>
  • Loading branch information
HiranmoyChowdhury committed May 29, 2024
1 parent ec465c5 commit ea06967
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pgbouncer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type Client struct {

type XormClient struct {
*xorm.Engine
podName string
}

type XormClientList struct {
Expand Down
2 changes: 2 additions & 0 deletions pgbouncer/kubedb_client_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func (o *KubeDBClientBuilder) GetPgBouncerXormClient() (*XormClient, error) {
engine.SetDefaultContext(o.ctx)
return &XormClient{
engine,
o.podName,
}, nil
}

Expand Down Expand Up @@ -211,6 +212,7 @@ func GetXormClientList(kc client.Client, pb *api.PgBouncer, ctx context.Context,
if len(clientlist.List) != int(*pb.Spec.Replicas) {
return nil, fmt.Errorf("Failed to generate Xorm Client List")
}

return clientlist, nil
}

Expand Down

0 comments on commit ea06967

Please sign in to comment.