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

Open Beginner friendly
#837 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
82/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Quiet
Tech stack
go
Domain
cli

Research direction

Open cmd/urunc/create.go and inspect createReexecCmd, focusing on how _LIBCONTAINER_LOGLEVEL is added to reexecCommand.Env. Confirm the conversion always produces a non-empty value, then simplify the dead conditional and run the relevant Go tests to ensure re-exec command construction still passes.

Written by the indexing model from the issue text.

Description

enhancement

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 .

Dominant language
Go
Stars
298
Forks
202
Avg merge
2d 18h
Merged PRs (30d)
28

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from urunc-dev/urunc

All issues in urunc-dev/urunc

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.