Skip to content

Commit

Permalink
shimv2: add a comment in checkAndMount()
Browse files Browse the repository at this point in the history
In checkAndMount(), it is not clear why we check IsBlockDevice() and if
DisableBlockDeviceUse == false and then only return "false, nil" instead
of "false, err". Adding a comment to make it a bit more readable.

Fixes: #732
Signed-off-by: Qian Cai <cai@redhat.com>
  • Loading branch information
Qian Cai committed Sep 15, 2020
1 parent 059e642 commit 7225460
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/runtime/containerd-shim-v2/create.go
Expand Up @@ -179,6 +179,7 @@ func checkAndMount(s *service, r *taskAPI.CreateTaskRequest) (bool, error) {
if len(r.Rootfs) == 1 {
m := r.Rootfs[0]

// Plug the block backed rootfs directly instead of mounting it.
if katautils.IsBlockDevice(m.Source) && !s.config.HypervisorConfig.DisableBlockDeviceUse {
return false, nil
}
Expand Down

0 comments on commit 7225460

Please sign in to comment.