Skip to content

Commit cf577da

Browse files
authored
nit(remapped-rows): simplify reason message (#529)
Signed-off-by: Gyuho Lee <[email protected]> Signed-off-by: Gyuho Lee <[email protected]>
1 parent e84ae4e commit cf577da

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

components/accelerator/nvidia/remapped-rows/component_output.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ func ToOutput(i *nvidia_query.Output) *Output {
3131

3232
requiresReset := device.RemappedRows.RequiresReset()
3333
if requiresReset {
34-
msg := fmt.Sprintf("GPU %s needs reset (detected pending row remapping)", device.UUID)
34+
msg := fmt.Sprintf("%s needs reset (detected pending row remapping)", device.UUID)
3535
needRebootMsgs = append(needRebootMsgs, msg)
3636
}
3737

3838
rma := device.RemappedRows.QualifiesForRMA()
3939
if rma {
40-
msg := fmt.Sprintf("GPU %s qualifies for RMA (row remapping failed)", device.UUID)
40+
msg := fmt.Sprintf("%s qualifies for RMA (row remapping failed)", device.UUID)
4141
rmaMsgs = append(rmaMsgs, msg)
4242
}
4343
}
@@ -103,11 +103,11 @@ func (o *Output) Evaluate() (string, bool, error) {
103103
for _, r := range o.RemappedRowsNVML {
104104
if r.QualifiesForRMA() {
105105
healthy = false
106-
reasons = append(reasons, fmt.Sprintf("GPU %s qualifies for RMA (row remapping failed, remapped due to %d uncorrectable error(s))", r.UUID, r.RemappedDueToUncorrectableErrors))
106+
reasons = append(reasons, fmt.Sprintf("%s qualifies for RMA (row remapping failed, remapped due to %d uncorrectable error(s))", r.UUID, r.RemappedDueToUncorrectableErrors))
107107
}
108108
if r.RequiresReset() {
109109
healthy = false
110-
reasons = append(reasons, fmt.Sprintf("GPU %s needs reset (detected pending row remapping)", r.UUID))
110+
reasons = append(reasons, fmt.Sprintf("%s needs reset (detected pending row remapping)", r.UUID))
111111
}
112112
}
113113

components/accelerator/nvidia/remapped-rows/component_output_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func TestOutput_Evaluate(t *testing.T) {
156156
},
157157
},
158158
},
159-
wantReason: `GPU GPU-456 qualifies for RMA (row remapping failed, remapped due to 1 uncorrectable error(s))`,
159+
wantReason: `GPU-456 qualifies for RMA (row remapping failed, remapped due to 1 uncorrectable error(s))`,
160160
wantHealthy: false,
161161
wantErr: false,
162162
},
@@ -174,7 +174,7 @@ func TestOutput_Evaluate(t *testing.T) {
174174
},
175175
},
176176
},
177-
wantReason: `GPU GPU-456 needs reset (detected pending row remapping)`,
177+
wantReason: `GPU-456 needs reset (detected pending row remapping)`,
178178
wantHealthy: false,
179179
wantErr: false,
180180
},
@@ -192,7 +192,7 @@ func TestOutput_Evaluate(t *testing.T) {
192192
},
193193
},
194194
},
195-
wantReason: `GPU GPU-456 needs reset (detected pending row remapping)`,
195+
wantReason: `GPU-456 needs reset (detected pending row remapping)`,
196196
wantHealthy: false,
197197
wantErr: false,
198198
},

0 commit comments

Comments
 (0)