m/node/allocs: split new package off m/node
The metropolis/node package contains various unrelated things. One of
these things are node-wide allocations of identifiers.
These are moved here to the new metropolis/node/allocs package.
Additionally, the constants are renamed to move the type of identifier
in front.
Change-Id: Ibc841ca64d4450a7054463e6d2d44753a118e07a
Reviewed-on: https://review.monogon.dev/c/monogon/+/4566
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/node/core/consensus/configuration.go b/metropolis/node/core/consensus/configuration.go
index 8c4bd06..dfd70f2 100644
--- a/metropolis/node/core/consensus/configuration.go
+++ b/metropolis/node/core/consensus/configuration.go
@@ -15,7 +15,7 @@
clientv3 "go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/server/v3/embed"
- "source.monogon.dev/metropolis/node"
+ "source.monogon.dev/metropolis/node/allocs"
"source.monogon.dev/metropolis/node/core/localstorage"
"source.monogon.dev/osbase/pki"
)
@@ -90,7 +90,7 @@
// over TLS. This requires TLS credentials to be present on disk, and will be
// disabled for bootstrapping the instance.
func (c *Config) build(enablePeers bool) *embed.Config {
- port := int(node.ConsensusPort)
+ port := int(allocs.PortConsensus)
if p := c.testOverrides.externalPort; p != 0 {
port = p
}
@@ -98,7 +98,7 @@
if c.testOverrides.externalAddress != "" {
host = c.testOverrides.externalAddress
}
- etcdPort := int(node.MetricsEtcdListenerPort)
+ etcdPort := int(allocs.PortMetricsEtcdListener)
if p := c.testOverrides.etcdMetricsPort; p != 0 {
etcdPort = p
}