Skip to content

refactor(unikernels): redundant if l.Monitor == "firecracker" inside firecracker case in Linux.MonitorBlockCli #747

@DevMhrn

Description

@DevMhrn

Refactor

Linux.MonitorBlockCli in pkg/unikontainers/unikernels/linux.go contains a dead conditional inside its case "firecracker": switch arm. The if l.Monitor == "firecracker" is always true at that point, because the surrounding switch l.Monitor has already selected that case.

This is a code-quality/ readability issue only.

Location

pkg/unikontainers/unikernels/linux.go, around lines 171-181 (current main):

case "firecracker":
    for _, aBlock := range l.Blk {
        id := aBlock.ID
        if l.Monitor == "firecracker" {   // <-- always true here
            id = "FC" + aBlock.ID
        }   
        blkArgs = append(blkArgs, types.MonitorBlockArgs{
            ID:   id,
            Path: aBlock.Source,
        })
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions