metropolis: reduce usage of identity.NodeID
Eventually, we want to be able to rotate node keypairs. To allow this,
the node ID needs to become independent of the public key. This change
is a refactoring which starts this work by reducing the usage of
identity.NodeID, the function which derives a node ID from a public key.
Change-Id: I5231ed0a7be37c23327fec93481b00c74374af07
Reviewed-on: https://review.monogon.dev/c/monogon/+/3445
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/cli/metroctl/cmd_node_approve.go b/metropolis/cli/metroctl/cmd_node_approve.go
index 294f8c3..a70f6b3 100644
--- a/metropolis/cli/metroctl/cmd_node_approve.go
+++ b/metropolis/cli/metroctl/cmd_node_approve.go
@@ -10,7 +10,6 @@
"github.com/spf13/cobra"
"source.monogon.dev/metropolis/cli/metroctl/core"
- "source.monogon.dev/metropolis/node/core/identity"
"source.monogon.dev/metropolis/proto/api"
)
@@ -28,7 +27,7 @@
// nodeById returns the node matching id, if it exists within nodes.
func nodeById(nodes []*api.Node, id string) *api.Node {
for _, n := range nodes {
- if identity.NodeID(n.Pubkey) == id {
+ if n.Id == id {
return n
}
}
@@ -52,7 +51,7 @@
// If no id was given, just list the nodes pending approval.
if len(nodes) != 0 {
for _, n := range nodes {
- fmt.Println(identity.NodeID(n.Pubkey))
+ fmt.Println(n.Id)
}
} else {
log.Print("There are no nodes pending approval at this time.")