Update against new nodeenrollment registration cache
This commit is contained in:
1 parent
1f550722a2
commit
f6ef708466
4 files changed
+12
-27
No files matched your search
@@ -43,6 +43,7 @@ import (
|
||||
"github.com/hashicorp/go-cleanhttp"
|
||||
"github.com/hashicorp/go-secure-stdlib/listenerutil"
|
||||
"github.com/hashicorp/go-secure-stdlib/strutil"
|
||||
"github.com/hashicorp/nodeenrollment"
|
||||
"github.com/hashicorp/nodeenrollment/types"
|
||||
"github.com/mr-tron/base58"
|
||||
"google.golang.org/grpc"
|
||||
@@ -573,19 +574,9 @@ func handleNodes(c *Controller) http.Handler {
|
||||
}
|
||||
var err error
|
||||
var currVals vals
|
||||
waitingNodes, err := c.NodeeFileStorage.List(c.baseContext, (*types.NodeInformation)(nil))
|
||||
if err != nil {
|
||||
_, _ = w.Write([]byte(err.Error()))
|
||||
w.WriteHeader(500)
|
||||
return
|
||||
}
|
||||
for _, keyId := range waitingNodes {
|
||||
ni, err := types.LoadNodeInformation(c.baseContext, c.NodeeFileStorage, keyId)
|
||||
if err != nil {
|
||||
_, _ = w.Write([]byte(err.Error()))
|
||||
w.WriteHeader(500)
|
||||
return
|
||||
}
|
||||
waitingNodes := nodeenrollment.DefaultRegistrationCache.Items()
|
||||
for keyId, val := range waitingNodes {
|
||||
ni := val.(*types.NodeInformation)
|
||||
if ni.Authorized {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user