@@ -16,23 +16,24 @@ import (
16
16
17
17
// maxJSONLevel the max level of json
18
18
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"
36
37
)
37
38
38
39
type SyncMode string
@@ -52,6 +53,7 @@ type Node struct {
52
53
Attributes map [string ]interface {} `json:"attr,omitempty" yaml:"attr,omitempty"`
53
54
Report Report `json:"report,omitempty" yaml:"report,omitempty"`
54
55
Desire Desire `json:"desire,omitempty" yaml:"desire,omitempty"`
56
+ OptionalSysApps []string `json:"optionalSysApps,omitempty" yaml:"optionalSysApps,omitempty"`
55
57
Description string `json:"description,omitempty" yaml:"description,omitempty"`
56
58
}
57
59
@@ -65,6 +67,7 @@ type NodeView struct {
65
67
Annotations map [string ]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
66
68
Report * ReportView `json:"report,omitempty" yaml:"report,omitempty"`
67
69
Desire Desire `json:"desire,omitempty" yaml:"desire,omitempty"`
70
+ OptionalSysApps []string `json:"optionalSysApps,omitempty" yaml:"optionalSysApps,omitempty"`
68
71
Description string `json:"description,omitempty" yaml:"description,omitempty"`
69
72
Ready bool `json:"ready"`
70
73
Mode SyncMode `json:"mode"`
@@ -228,6 +231,9 @@ func (n *Node) View(timeout time.Duration) (*NodeView, error) {
228
231
if val , ok := attr [KeyAccelerator ]; ok {
229
232
view .Accelerator , _ = val .(string )
230
233
}
234
+ if val , ok := attr [KeyOptionalSysApps ]; ok {
235
+ view .OptionalSysApps , _ = val .([]string )
236
+ }
231
237
}
232
238
if err = view .populateNodeStats (timeout ); err != nil {
233
239
return nil , errors .Trace (err )
0 commit comments