Skip to content

Commit

Permalink
store node init resource
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS committed Nov 16, 2018
1 parent 1039dc8 commit 275e6f2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
16 changes: 9 additions & 7 deletions store/etcdv3/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ func (m *Mercury) AddNode(ctx context.Context, name, endpoint, podname, ca, cert
}

node := &types.Node{
Name: name,
Endpoint: endpoint,
Podname: podname,
CPU: cpumap,
MemCap: memcap,
Available: true,
Labels: labels,
Name: name,
Endpoint: endpoint,
Podname: podname,
CPU: cpumap,
MemCap: memcap,
InitCPU: cpumap,
InitMemCap: memcap,
Available: true,
Labels: labels,
}

bytes, err := json.Marshal(node)
Expand Down
18 changes: 10 additions & 8 deletions types/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ func (c CPUMap) Sub(q CPUMap) {

// Node store node info
type Node struct {
Name string `json:"name"`
Endpoint string `json:"endpoint"`
Podname string `json:"podname"`
Available bool `json:"available"`
CPU CPUMap `json:"cpu"`
MemCap int64 `json:"memcap"`
Labels map[string]string `json:"labels"`
Engine *engineapi.Client `json:"-"`
Name string `json:"name"`
Endpoint string `json:"endpoint"`
Podname string `json:"podname"`
Available bool `json:"available"`
CPU CPUMap `json:"cpu"`
MemCap int64 `json:"memcap"`
Labels map[string]string `json:"labels"`
InitCPU CPUMap `json:"init_cpu"`
InitMemCap int64 `json:"init_memcap"`
Engine *engineapi.Client `json:"-"`
}

// Info show node info
Expand Down

0 comments on commit 275e6f2

Please sign in to comment.