fleetlint Policy for a fleet of repositories
v0.11 (latest)
Getting started

taskrunner/container

The task runner uses the container

Severitywarning
Tiers1, 2
Stacksany
Scoperoot
Kindoutcome
Sourcelibrary v0.8.0
Selected byfleetlint-recommended@v0.8.0

Requirement

When facts.container is devcontainer (the default once a devcontainer.json exists), docker or podman, a target called outside the container runs inside it, so results do not depend on what is installed on the machine. Any way of getting there counts: the devcontainer CLI, docker run or docker compose exec, podman; another one is added with accept:. A switch (CONTAINER=0) keeps running on the machine possible, and facts.container: none says the repository runs there.

Why

A container that the gates do not use is a second environment next to the real one, and the two drift apart.

Applies when

repo.container != "none" && taskrunner.kind in ["make", "just", "task"]

Fix

Forward the targets into the container when the runner is called outside it (fleetlint fix writes such a runner file when there is none), or set facts.container: none.

Agent instruction: At the top of the task runner file add a CONTAINER switch defaulting to 1 and, when it is 1 and IN_CONTAINER is unset, run each target inside the container (devcontainer exec, docker run or podman run); keep the existing recipes for the other case. Set IN_CONTAINER=1 inside the container.

fleetlint fix can apply this rule’s fix automatically (1 action(s)).

A finding that names no file points at the task runner’s file, or Makefile when there is none.

Sources


Generated by fleetlint docs from catalog v0.8.0.