mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Remove join-tokens from the /info API
join-tokens are not needed for this endpoint, and should not be as part of /info Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
parent
69080f423d
commit
d8f3b3f006
5 changed files with 32 additions and 18 deletions
|
@ -733,7 +733,10 @@ func (c *Cluster) Info() types.Info {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
info.Error = err.Error()
|
info.Error = err.Error()
|
||||||
}
|
}
|
||||||
info.Cluster = swarm
|
|
||||||
|
// Strip JoinTokens
|
||||||
|
info.Cluster = swarm.ClusterInfo
|
||||||
|
|
||||||
if r, err := c.client.ListNodes(ctx, &swarmapi.ListNodesRequest{}); err == nil {
|
if r, err := c.client.ListNodes(ctx, &swarmapi.ListNodesRequest{}); err == nil {
|
||||||
info.Nodes = len(r.Nodes)
|
info.Nodes = len(r.Nodes)
|
||||||
for _, n := range r.Nodes {
|
for _, n := range r.Nodes {
|
||||||
|
|
|
@ -13,17 +13,19 @@ import (
|
||||||
// SwarmFromGRPC converts a grpc Cluster to a Swarm.
|
// SwarmFromGRPC converts a grpc Cluster to a Swarm.
|
||||||
func SwarmFromGRPC(c swarmapi.Cluster) types.Swarm {
|
func SwarmFromGRPC(c swarmapi.Cluster) types.Swarm {
|
||||||
swarm := types.Swarm{
|
swarm := types.Swarm{
|
||||||
ID: c.ID,
|
ClusterInfo: types.ClusterInfo{
|
||||||
Spec: types.Spec{
|
ID: c.ID,
|
||||||
Orchestration: types.OrchestrationConfig{
|
Spec: types.Spec{
|
||||||
TaskHistoryRetentionLimit: c.Spec.Orchestration.TaskHistoryRetentionLimit,
|
Orchestration: types.OrchestrationConfig{
|
||||||
},
|
TaskHistoryRetentionLimit: c.Spec.Orchestration.TaskHistoryRetentionLimit,
|
||||||
Raft: types.RaftConfig{
|
},
|
||||||
SnapshotInterval: c.Spec.Raft.SnapshotInterval,
|
Raft: types.RaftConfig{
|
||||||
KeepOldSnapshots: c.Spec.Raft.KeepOldSnapshots,
|
SnapshotInterval: c.Spec.Raft.SnapshotInterval,
|
||||||
LogEntriesForSlowFollowers: c.Spec.Raft.LogEntriesForSlowFollowers,
|
KeepOldSnapshots: c.Spec.Raft.KeepOldSnapshots,
|
||||||
HeartbeatTick: c.Spec.Raft.HeartbeatTick,
|
LogEntriesForSlowFollowers: c.Spec.Raft.LogEntriesForSlowFollowers,
|
||||||
ElectionTick: c.Spec.Raft.ElectionTick,
|
HeartbeatTick: c.Spec.Raft.HeartbeatTick,
|
||||||
|
ElectionTick: c.Spec.Raft.ElectionTick,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
JoinTokens: types.JoinTokens{
|
JoinTokens: types.JoinTokens{
|
||||||
|
|
|
@ -60,7 +60,7 @@ clone git golang.org/x/net 2beffdc2e92c8a3027590f898fe88f69af48a3f8 https://gith
|
||||||
clone git golang.org/x/sys eb2c74142fd19a79b3f237334c7384d5167b1b46 https://github.com/golang/sys.git
|
clone git golang.org/x/sys eb2c74142fd19a79b3f237334c7384d5167b1b46 https://github.com/golang/sys.git
|
||||||
clone git github.com/docker/go-units 651fc226e7441360384da338d0fd37f2440ffbe3
|
clone git github.com/docker/go-units 651fc226e7441360384da338d0fd37f2440ffbe3
|
||||||
clone git github.com/docker/go-connections fa2850ff103453a9ad190da0df0af134f0314b3d
|
clone git github.com/docker/go-connections fa2850ff103453a9ad190da0df0af134f0314b3d
|
||||||
clone git github.com/docker/engine-api a52656d77f09d394104c1639824eada038bfdb89
|
clone git github.com/docker/engine-api 3d1601b9d2436a70b0dfc045a23f6503d19195df
|
||||||
clone git github.com/RackSec/srslog 259aed10dfa74ea2961eddd1d9847619f6e98837
|
clone git github.com/RackSec/srslog 259aed10dfa74ea2961eddd1d9847619f6e98837
|
||||||
clone git github.com/imdario/mergo 0.2.1
|
clone git github.com/imdario/mergo 0.2.1
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,17 @@ package swarm
|
||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
// Swarm represents a swarm.
|
// ClusterInfo represents info about a the cluster for outputing in "info"
|
||||||
type Swarm struct {
|
// it contains the same information as "Swarm", but without the JoinTokens
|
||||||
|
type ClusterInfo struct {
|
||||||
ID string
|
ID string
|
||||||
Meta
|
Meta
|
||||||
Spec Spec
|
Spec Spec
|
||||||
|
}
|
||||||
|
|
||||||
|
// Swarm represents a swarm.
|
||||||
|
type Swarm struct {
|
||||||
|
ClusterInfo
|
||||||
JoinTokens JoinTokens
|
JoinTokens JoinTokens
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +125,7 @@ type Info struct {
|
||||||
Nodes int
|
Nodes int
|
||||||
Managers int
|
Managers int
|
||||||
|
|
||||||
Cluster Swarm
|
Cluster ClusterInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
// Peer represents a peer.
|
// Peer represents a peer.
|
||||||
|
|
|
@ -256,7 +256,10 @@ type Info struct {
|
||||||
Runtimes map[string]Runtime
|
Runtimes map[string]Runtime
|
||||||
DefaultRuntime string
|
DefaultRuntime string
|
||||||
Swarm swarm.Info
|
Swarm swarm.Info
|
||||||
LiveRestore bool
|
// LiveRestoreEnabled determines whether containers should be kept
|
||||||
|
// running when the daemon is shutdown or upon daemon start if
|
||||||
|
// running containers are detected
|
||||||
|
LiveRestoreEnabled bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// PluginsInfo is a temp struct holding Plugins name
|
// PluginsInfo is a temp struct holding Plugins name
|
||||||
|
|
Loading…
Reference in a new issue