Skip to content

Commit aa00359

Browse files
authored
add sysapps (#220)
1 parent 37a7294 commit aa00359

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

spec/v1/node.go

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,24 @@ import (
1616

1717
// maxJSONLevel the max level of json
1818
const (
19-
maxJSONLevel = 5
20-
milliPrecision = 1000
21-
KeySyncMode = "syncMode"
22-
CloudMode SyncMode = "cloud"
23-
LocalMode SyncMode = "local"
24-
KeyNodeProps = "nodeprops"
25-
KeyDevices = "devices"
26-
KeyApps = "apps"
27-
KeySysApps = "sysapps"
28-
KeyAppStats = "appstats"
29-
KeySysAppStats = "sysappstats"
30-
KeyAccelerator = "accelerator"
31-
NVAccelerator = "nvidia"
32-
ResourceGPU = "gpu"
33-
KeyGPUUsedMemory = "usedMemory"
34-
KeyGPUTotalMemory = "totalMemory"
35-
KeyGPUPercent = "percent"
19+
maxJSONLevel = 5
20+
milliPrecision = 1000
21+
KeySyncMode = "syncMode"
22+
CloudMode SyncMode = "cloud"
23+
LocalMode SyncMode = "local"
24+
KeyNodeProps = "nodeprops"
25+
KeyDevices = "devices"
26+
KeyApps = "apps"
27+
KeySysApps = "sysapps"
28+
KeyAppStats = "appstats"
29+
KeySysAppStats = "sysappstats"
30+
KeyAccelerator = "accelerator"
31+
KeyOptionalSysApps = "optionalSysApps"
32+
NVAccelerator = "nvidia"
33+
ResourceGPU = "gpu"
34+
KeyGPUUsedMemory = "usedMemory"
35+
KeyGPUTotalMemory = "totalMemory"
36+
KeyGPUPercent = "percent"
3637
)
3738

3839
type SyncMode string
@@ -52,6 +53,7 @@ type Node struct {
5253
Attributes map[string]interface{} `json:"attr,omitempty" yaml:"attr,omitempty"`
5354
Report Report `json:"report,omitempty" yaml:"report,omitempty"`
5455
Desire Desire `json:"desire,omitempty" yaml:"desire,omitempty"`
56+
OptionalSysApps []string `json:"optionalSysApps,omitempty" yaml:"optionalSysApps,omitempty"`
5557
Description string `json:"description,omitempty" yaml:"description,omitempty"`
5658
}
5759

@@ -65,6 +67,7 @@ type NodeView struct {
6567
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
6668
Report *ReportView `json:"report,omitempty" yaml:"report,omitempty"`
6769
Desire Desire `json:"desire,omitempty" yaml:"desire,omitempty"`
70+
OptionalSysApps []string `json:"optionalSysApps,omitempty" yaml:"optionalSysApps,omitempty"`
6871
Description string `json:"description,omitempty" yaml:"description,omitempty"`
6972
Ready bool `json:"ready"`
7073
Mode SyncMode `json:"mode"`
@@ -228,6 +231,9 @@ func (n *Node) View(timeout time.Duration) (*NodeView, error) {
228231
if val, ok := attr[KeyAccelerator]; ok {
229232
view.Accelerator, _ = val.(string)
230233
}
234+
if val, ok := attr[KeyOptionalSysApps]; ok {
235+
view.OptionalSysApps, _ = val.([]string)
236+
}
231237
}
232238
if err = view.populateNodeStats(timeout); err != nil {
233239
return nil, errors.Trace(err)

0 commit comments

Comments
 (0)