From 8c8688ca6b58226b203c4e17e1aabb396a22228a Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 29 Sep 2022 13:06:57 -0400 Subject: [PATCH] satellite/overlay: return email as part of NodeReputation Make email accessible for email sending after reputation updates Change-Id: I760feee0f6ca58b76a2955a04c0c366c618656bb --- satellite/overlay/service.go | 1 + satellite/satellitedb/overlaycache.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/satellite/overlay/service.go b/satellite/overlay/service.go index a5c844f26..6af746b0f 100644 --- a/satellite/overlay/service.go +++ b/satellite/overlay/service.go @@ -182,6 +182,7 @@ type NodeCriteria struct { // ReputationStatus indicates current reputation status for a node. type ReputationStatus struct { + Email string Disqualified *time.Time DisqualificationReason *DisqualificationReason UnknownAuditSuspended *time.Time diff --git a/satellite/satellitedb/overlaycache.go b/satellite/satellitedb/overlaycache.go index a63d4eecf..da27a778e 100644 --- a/satellite/satellitedb/overlaycache.go +++ b/satellite/satellitedb/overlaycache.go @@ -309,7 +309,7 @@ func (cache *overlaycache) getOnlineNodesForAuditRepair(ctx context.Context, nod var rows tagsql.Rows rows, err = cache.db.Query(ctx, cache.db.Rebind(` - SELECT last_net, id, address, last_ip_port, vetted_at, + SELECT last_net, id, address, email, last_ip_port, vetted_at, unknown_audit_suspended, offline_suspended FROM nodes WHERE id = any($1::bytea[]) @@ -328,7 +328,7 @@ func (cache *overlaycache) getOnlineNodesForAuditRepair(ctx context.Context, nod node.Address = &pb.NodeAddress{Transport: pb.NodeTransport_TCP_TLS_GRPC} var lastIPPort sql.NullString - err = rows.Scan(&node.LastNet, &node.ID, &node.Address.Address, &lastIPPort, &node.Reputation.VettedAt, &node.Reputation.UnknownAuditSuspended, &node.Reputation.OfflineSuspended) + err = rows.Scan(&node.LastNet, &node.ID, &node.Address.Address, &node.Reputation.Email, &lastIPPort, &node.Reputation.VettedAt, &node.Reputation.UnknownAuditSuspended, &node.Reputation.OfflineSuspended) if err != nil { return nil, err }