opencontainers / opencontainers/runc

shell files: enable `set -u -e -o pipefail`.

Open
#3,399 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
13.5k
Forks
2.3k
Avg merge
2d 8h
Merged PRs (30d)
30

Description

We should make our shell code more strict, in particular:

  • enable set -u so that using an unset variable (which is most probably due to bad logic in the code) will trigger an error (see #3367)
  • enable set -e (which is already enabled for bats test cases (but not its setup/cleanup), but should probably be enabled universally)
  • enable set -o pipefail (where we explicitly use bash, of course)

Inspired by @tianon at https://github.com/opencontainers/runc/pull/3367/commits/38c21694ba8b3873c9d3792a19e0e4fcd46a887c#r814008189

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.

Research direction

Start by inventorying the repository's shell files and the existing bats test setup/cleanup mentioned in the issue. Check how shell code invokes bash before applying the requested strict-mode settings, then run the relevant shell and bats tests to confirm failures are surfaced consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, shell
Domain
cli, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.