smalltown -> metropolis
This pass removes all mentions of Smalltown, both from code and comments,
and replaces them with appropriate new terminology.
Test Plan: Refactor, covered by CI.
X-Origin-Diff: phab/D674
GitOrigin-RevId: 04a94d44ef07d46f7821530da5614daefe16d7ea
diff --git a/metropolis/node/core/cluster/manager.go b/metropolis/node/core/cluster/manager.go
index 6bb87f4..5f072b8 100644
--- a/metropolis/node/core/cluster/manager.go
+++ b/metropolis/node/core/cluster/manager.go
@@ -40,10 +40,10 @@
apb "git.monogon.dev/source/nexantic.git/metropolis/proto/api"
)
-// Manager is a finite state machine that joins this node (ie., Smalltown instance running on a virtual/physical machine)
-// into a Smalltown cluster (ie. group of nodes that act as a single control plane for Smalltown services). It does that
-// by bringing up all required operating-system level components, including mounting the local filesystem, bringing up
-// a consensus (etcd) server/client, ...
+// Manager is a finite state machine that joins this node (ie., Metropolis node running on a virtual/physical machine)
+// into a Metropolis cluster (ie. group of nodes that act as a single control plane for Metropolis services). It does
+// this by bringing up all required operating-system level components, including mounting the local filesystem, bringing
+// up a consensus (etcd) server/client, ...
//
// The Manager runs as a single-shot Runnable. It will attempt to progress its state from the initial state (New) to
// either Running (meaning that the node is now part of a cluster), or Failed (meaning that the node couldn't become
@@ -99,7 +99,7 @@
// with no EnrolmentConfig.
StateCreatingCluster
// StateCharlie is when the Manager uses the Golden Ticket debug/stopgap system to join an already
- // existing cluster. This mechanism will be removed before the first Smalltown release.
+ // existing cluster. This mechanism will be removed before the first Metropolis release.
StateCharlie
// StateRunning is when the Manager successfully got the node to be part of a cluster. stateRunningNode is valid.
StateRunning
@@ -267,7 +267,7 @@
if err != nil && !os.IsNotExist(err) {
return fmt.Errorf("could not read local enrolment file: %w", err)
} else if err != nil {
- configRaw, err = ioutil.ReadFile("/sys/firmware/qemu_fw_cfg/by_name/com.nexantic.smalltown/enrolment.pb/raw")
+ configRaw, err = ioutil.ReadFile("/sys/firmware/qemu_fw_cfg/by_name/dev.monogon.metropolis/enrolment.pb/raw")
if err != nil && !os.IsNotExist(err) {
return fmt.Errorf("could not read firmware enrolment file: %w", err)
}
@@ -381,7 +381,7 @@
}
// stateCharlie is used to join an existing cluster via the GoldenTicket mechanism. This mechanism is temporarily
-// implemented in Smalltown in order to allow for testing multi-node clusters without a TPM attestation flow implemented.
+// implemented in Metropolis in order to allow for testing multi-node clusters without a TPM attestation flow implemented.
// The Golden Ticket contains a pregenerated node certificate, etcd certificate, and other data that any node can
// use to join the cluster.
// Since this flow is temporary, it has a slight impedance mismatch with methods exposed by localstorage, node, etc.,
@@ -394,8 +394,8 @@
// was generated (vs. being created now by an RPC call, via an promote-node-to-etcd-member flow)
// - the node is then promoted to a consensus member and kubernetes worker, its clusterunlock key is set, and then it
// is saved to etcd.
-// As such, in this flow, we first create an etcd member (on goldenticket generation), and then only create a new Smalltown
-// node (when the goldenticket is used).
+// As such, in this flow, we first create an etcd member (on goldenticket generation), and then only create a new
+// Metropolis node (when the goldenticket is used).
func (m *Manager) stateCharlie(ctx context.Context) error {
t := m.goldenTicket
nodeCert, err := x509.ParseCertificate(t.NodeCert)
diff --git a/metropolis/node/core/cluster/node.go b/metropolis/node/core/cluster/node.go
index 449c2ff..4240428 100644
--- a/metropolis/node/core/cluster/node.go
+++ b/metropolis/node/core/cluster/node.go
@@ -32,9 +32,9 @@
ipb "git.monogon.dev/source/nexantic.git/metropolis/proto/internal"
)
-// Node is a Smalltown cluster member. A node is a virtual or physical machine running Smalltown. This object represents a
-// node only as part of a Cluster - ie., this object will never be available outside of //metropolis/node/core/cluster
-// if the Node is not part of a Cluster.
+// Node is a Metropolis cluster member. A node is a virtual or physical machine running Metropolis. This object
+// represents a node only as part of a cluster - ie., this object will never be available outside of
+// //metropolis/node/core/cluster if the Node is not part of a Cluster.
// Nodes are inherently tied to their long term storage, which is etcd. As such, methods on this object relate heavily
// to the Node's expected lifecycle on etcd.
type Node struct {
@@ -43,7 +43,7 @@
// the Node was just created (as the key is generated locally by localstorage on first format/mount).
// The other part of the unlock key is the LocalUnlockKey that's present on the node's ESP partition.
clusterUnlockKey []byte
- // certificate is the node's TLS certificate, used to authenticate Smalltown gRPC calls/services (but not
+ // certificate is the node's TLS certificate, used to authenticate Metropolis gRPC calls/services (but not
// consensus/etcd). The certificate for a node is permanent (and never expires). It's self-signed by the node on
// startup, and contains the node's IP address in its SAN. Callers/services should check directly against the
// expected certificate, and not against a CA.
@@ -83,10 +83,10 @@
nodeName string
}
-// ID returns the name of this node, which is `smalltown-{pubkeyHash}`. This name should be the primary way to refer to
-// Smalltown nodes within a cluster, and is guaranteed to be unique by relying on cryptographic randomness.
+// ID returns the name of this node, which is `metropolis-{pubkeyHash}`. This name should be the primary way to refer to
+// Metropoils nodes within a cluster, and is guaranteed to be unique by relying on cryptographic randomness.
func (n *Node) ID() string {
- return fmt.Sprintf("smalltown-%s", n.IDBare())
+ return fmt.Sprintf("metropolis-%s", n.IDBare())
}
// IDBare returns the `{pubkeyHash}` part of the node ID.