Skip to content

cleanup bug : createReexecCmd: dead if logLevel != "" guard around _LIBCONTAINER_LOGLEVEL #837

Description

@shivansh-source

In createReexecCmd (cmd/urunc/create.go), the log level env var is gated on a condition that can never be false:

logLevel := strconv.Itoa(int(logrus.GetLevel()))
if logLevel != "" {
    reexecCommand.Env = append(reexecCommand.Env, "_LIBCONTAINER_LOGLEVEL="+logLevel)
}

strconv.Itoa always returns a non-empty string . so logLevel != "" is always true and the guard is dead code

not a functionality bug only a cleanup issue .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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