aboutsummaryrefslogtreecommitdiff
path: root/pkg/atlas/server.go
diff options
context:
space:
mode:
authorpg9182 <96569817+pg9182@users.noreply.github.com>2023-03-08 19:48:50 -0500
committerpg9182 <96569817+pg9182@users.noreply.github.com>2023-04-17 14:49:47 -0400
commitf6d85eaf1c969bfc10d70d57c43328588d69fde1 (patch)
tree7acf6a17e317e4ff49c88fbe8e87950466d530ea /pkg/atlas/server.go
parent118fbcdd6510a1a449b1aacf451db60aa72dd804 (diff)
downloadAtlas-f6d85eaf1c969bfc10d70d57c43328588d69fde1.tar.gz
Atlas-f6d85eaf1c969bfc10d70d57c43328588d69fde1.zip
pkg/api/api0, pkg/atlas: Use new nspkt package
Diffstat (limited to 'pkg/atlas/server.go')
-rw-r--r--pkg/atlas/server.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/atlas/server.go b/pkg/atlas/server.go
index c8f39f4..2956401 100644
--- a/pkg/atlas/server.go
+++ b/pkg/atlas/server.go
@@ -28,6 +28,7 @@ import (
"github.com/r2northstar/atlas/pkg/cloudflare"
"github.com/r2northstar/atlas/pkg/eax"
"github.com/r2northstar/atlas/pkg/memstore"
+ "github.com/r2northstar/atlas/pkg/nspkt"
"github.com/r2northstar/atlas/pkg/origin"
"github.com/r2northstar/atlas/pkg/regionmap"
"github.com/rs/zerolog"
@@ -270,6 +271,7 @@ func NewServer(c *Config) (*Server, error) {
m.Add(hlog.RequestIDHandler("rid", ""))
s.API0 = &api0.Handler{
+ NSPkt: nspkt.NewListener(),
ServerList: api0.NewServerList(c.API0_ServerList_DeadTime, c.API0_ServerList_GhostTime, c.API0_ServerList_VerifyTime, api0.ServerListConfig{
ExperimentalDeterministicServerIDSecret: c.API0_ServerList_ExperimentalDeterministicServerIDSecret,
AllowUwuify: c.AllowJokes,
@@ -913,6 +915,9 @@ func (s *Server) Run(ctx context.Context) error {
}
}()
}
+ go func() {
+ errch <- s.API0.NSPkt.ListenAndServe(netip.AddrPort{})
+ }()
select {
case <-ctx.Done():
@@ -984,6 +989,7 @@ func (s *Server) serveRest(w http.ResponseWriter, r *http.Request) {
if internal {
ms = append(ms, metrics.WriteProcessMetrics)
ms = append(ms, s.API0.WritePrometheus)
+ ms = append(ms, s.API0.NSPkt.WritePrometheus)
}
ms = append(ms, s.API0.ServerList.WritePrometheus)
if internal && geo {