Skip to content

Commit 9ba82ac

Browse files
committed
Refactor ContainerEdits.isEmpty
Signed-off-by: Evan Lezar <[email protected]>
1 parent eb0daa7 commit 9ba82ac

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

pkg/cdi/container-edits.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,25 @@ func (e *ContainerEdits) isEmpty() bool {
225225
if e == nil {
226226
return false
227227
}
228-
return len(e.Env)+len(e.DeviceNodes)+len(e.Hooks)+len(e.Mounts)+len(e.AdditionalGIDs) == 0 && e.IntelRdt == nil
228+
if len(e.Env) > 0 {
229+
return false
230+
}
231+
if len(e.DeviceNodes) > 0 {
232+
return false
233+
}
234+
if len(e.Hooks) > 0 {
235+
return false
236+
}
237+
if len(e.Mounts) > 0 {
238+
return false
239+
}
240+
if len(e.AdditionalGIDs) > 0 {
241+
return false
242+
}
243+
if e.IntelRdt != nil {
244+
return false
245+
}
246+
return true
229247
}
230248

231249
// ValidateEnv validates the given environment variables.

0 commit comments

Comments
 (0)