mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 16:26:38 +00:00
[management] Load missing service columns in pgx account loader (#5816)
This commit is contained in:
@@ -2080,7 +2080,8 @@ func (s *SqlStore) getPostureChecks(ctx context.Context, accountID string) ([]*p
|
|||||||
func (s *SqlStore) getServices(ctx context.Context, accountID string) ([]*rpservice.Service, error) {
|
func (s *SqlStore) getServices(ctx context.Context, accountID string) ([]*rpservice.Service, error) {
|
||||||
const serviceQuery = `SELECT id, account_id, name, domain, enabled, auth,
|
const serviceQuery = `SELECT id, account_id, name, domain, enabled, auth,
|
||||||
meta_created_at, meta_certificate_issued_at, meta_status, proxy_cluster,
|
meta_created_at, meta_certificate_issued_at, meta_status, proxy_cluster,
|
||||||
pass_host_header, rewrite_redirects, session_private_key, session_public_key
|
pass_host_header, rewrite_redirects, session_private_key, session_public_key,
|
||||||
|
mode, listen_port, port_auto_assigned, source, source_peer, terminated
|
||||||
FROM services WHERE account_id = $1`
|
FROM services WHERE account_id = $1`
|
||||||
|
|
||||||
const targetsQuery = `SELECT id, account_id, service_id, path, host, port, protocol,
|
const targetsQuery = `SELECT id, account_id, service_id, path, host, port, protocol,
|
||||||
@@ -2097,6 +2098,7 @@ func (s *SqlStore) getServices(ctx context.Context, accountID string) ([]*rpserv
|
|||||||
var auth []byte
|
var auth []byte
|
||||||
var createdAt, certIssuedAt sql.NullTime
|
var createdAt, certIssuedAt sql.NullTime
|
||||||
var status, proxyCluster, sessionPrivateKey, sessionPublicKey sql.NullString
|
var status, proxyCluster, sessionPrivateKey, sessionPublicKey sql.NullString
|
||||||
|
var mode, source, sourcePeer sql.NullString
|
||||||
err := row.Scan(
|
err := row.Scan(
|
||||||
&s.ID,
|
&s.ID,
|
||||||
&s.AccountID,
|
&s.AccountID,
|
||||||
@@ -2112,6 +2114,12 @@ func (s *SqlStore) getServices(ctx context.Context, accountID string) ([]*rpserv
|
|||||||
&s.RewriteRedirects,
|
&s.RewriteRedirects,
|
||||||
&sessionPrivateKey,
|
&sessionPrivateKey,
|
||||||
&sessionPublicKey,
|
&sessionPublicKey,
|
||||||
|
&mode,
|
||||||
|
&s.ListenPort,
|
||||||
|
&s.PortAutoAssigned,
|
||||||
|
&source,
|
||||||
|
&sourcePeer,
|
||||||
|
&s.Terminated,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -2143,6 +2151,15 @@ func (s *SqlStore) getServices(ctx context.Context, accountID string) ([]*rpserv
|
|||||||
if sessionPublicKey.Valid {
|
if sessionPublicKey.Valid {
|
||||||
s.SessionPublicKey = sessionPublicKey.String
|
s.SessionPublicKey = sessionPublicKey.String
|
||||||
}
|
}
|
||||||
|
if mode.Valid {
|
||||||
|
s.Mode = mode.String
|
||||||
|
}
|
||||||
|
if source.Valid {
|
||||||
|
s.Source = source.String
|
||||||
|
}
|
||||||
|
if sourcePeer.Valid {
|
||||||
|
s.SourcePeer = sourcePeer.String
|
||||||
|
}
|
||||||
|
|
||||||
s.Targets = []*rpservice.Target{}
|
s.Targets = []*rpservice.Target{}
|
||||||
return &s, nil
|
return &s, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user