Skip to content

Commit 2ad90a6

Browse files
author
Michal Tichák
committed
[odc] plumbing for expendable and rmsjobid in odcdevice
1 parent f5f0e16 commit 2ad90a6

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

core/integration/odc/plugin.go

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,14 @@ type OdcPartitionInfo struct {
110110
}
111111

112112
type OdcDevice struct {
113-
TaskId string `json:"taskId"`
114-
State string `json:"state"`
115-
EcsState sm.State `json:"ecsState"`
116-
Path string `json:"path"`
117-
Ignored bool `json:"ignored"`
118-
Host string `json:"host"`
113+
TaskId string `json:"taskId"`
114+
State string `json:"state"`
115+
EcsState sm.State `json:"ecsState"`
116+
Path string `json:"path"`
117+
Ignored bool `json:"ignored"`
118+
Host string `json:"host"`
119+
Expendable bool `json:"expendable"`
120+
Rmsjobid string `json:"rmsjobid"`
119121
}
120122

121123
type partitionStateChangedEventPayload struct {
@@ -136,6 +138,8 @@ type deviceStateChangedEventPayload struct {
136138
Path string `json:"path"`
137139
Ignored bool `json:"ignored"`
138140
Host string `json:"host"`
141+
Expendable bool `json:"expendable"`
142+
Rmsjobid string `json:"rmsjobid"`
139143
}
140144

141145
func NewPlugin(endpoint string) integration.Plugin {
@@ -258,11 +262,13 @@ func (p *Plugin) queryPartitionStatus() {
258262
odcPartInfoSlice[idx].Devices = make(map[OdcDeviceId]*OdcDevice, len(odcPartStateRep.Devices))
259263
for _, device := range odcPartStateRep.Devices {
260264
odcPartInfoSlice[idx].Devices[OdcDeviceId(device.Id)] = &OdcDevice{
261-
TaskId: strconv.FormatUint(device.Id, 10),
262-
State: device.State,
263-
Path: device.Path,
264-
Ignored: device.Ignored,
265-
Host: device.Host,
265+
TaskId: strconv.FormatUint(device.Id, 10),
266+
State: device.State,
267+
Path: device.Path,
268+
Ignored: device.Ignored,
269+
Host: device.Host,
270+
Expendable: device.Expendable,
271+
Rmsjobid: device.Rmsjobid,
266272
}
267273
}
268274
}(i, id)
@@ -317,6 +323,8 @@ func (p *Plugin) queryPartitionStatus() {
317323
Path: device.Path,
318324
Ignored: device.Ignored,
319325
Host: device.Host,
326+
Expendable: device.Expendable,
327+
Rmsjobid: device.Rmsjobid,
320328
}
321329
payloadJson, _ := json.Marshal(payload)
322330

0 commit comments

Comments
 (0)