Skip to content

Commit

Permalink
adaptation: fix mount and device adjustment.
Browse files Browse the repository at this point in the history
Fix mount and device adjustment for container create request
processing. Mounts in the NRI create request got incorrectly
reset if a plugin ever modifed mounts. All subsequent plugins
received incorrect mount data in their creation request. The
same bug was present for device adjustment.

Note that this had a direct effect on the NRI creation request
but not the actual container itself.

Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Feb 15, 2023
1 parent 807de1e commit 43174d1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/adaptation/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,7 @@ func (r *result) adjustMounts(mounts []*Mount, plugin string) error {
}

// finally, apply additions/modifications to plugin container creation request
for _, m := range add {
create.Container.Mounts = append(r.reply.adjust.Mounts, m)
}
create.Container.Mounts = append(create.Container.Mounts, add...)

return nil
}
Expand Down Expand Up @@ -376,9 +374,7 @@ func (r *result) adjustDevices(devices []*LinuxDevice, plugin string) error {
}

// finally, apply additions/modifications to plugin container creation request
for _, d := range add {
create.Container.Linux.Devices = append(r.reply.adjust.Linux.Devices, d)
}
create.Container.Linux.Devices = append(create.Container.Linux.Devices, add...)

return nil
}
Expand Down

0 comments on commit 43174d1

Please sign in to comment.