Skip to content

feat: replace the bash cleaner with a Go eviction manager (stage 1) - #197

Draft
masontikhonov wants to merge 101 commits into
masterfrom
cleaner-redesign-stage-1
Draft

masontikhonov wants to merge 101 commits into
masterfrom
cleaner-redesign-stage-1

Conversation

@masontikhonov

@masontikhonov masontikhonov commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

What

Stage 1 of the dind cleaner redesign: the bash cleaner (cleaner-agent.sh, docker-clean.sh, docker-clean-sigterm.sh, functions.sh, the retain and period settings) is replaced by one Go process, dind-cleaner, that owns every eviction.

Draft: the integration suite has run on this head and one Docker behaviour test fails (see Verification).

This image must be released together with the chart change (see Configuration): the cleaner no longer reads any of the variables the chart sets today.

Behaviour

  • Evicts by need, not by age. Nothing is removed while free space and free inodes are above minFree (20% by default). A pass removes the least recently used cache first, across images, volumes and build cache, and stops at targetFree (25%).
  • Free space is what df shows as available, which leaves out the filesystem's root reserve. On ext4 (5% reserve) a pass therefore starts above 75% used and stops at 70%; on a filesystem with no reserve, at 80% and 75%.
  • Last use comes from Docker's live event stream, kept in a small state file on the volume. At start the cleaner replays the pod's events before it removes anything. Volume events are followed on a stream of their own, so a volume's use is never recorded late.
  • Two tiers. Tier 1 removes cache from before this build that nothing uses. Tier 2 opens only below emergencyFree (10%) with tier 1 empty, and removes this build's idle cache in order of harm: recreatable cache, exited containers, then unpushed local images.
  • Never evicted: anything in use, a named volume this build created or mounted, pinned items (CLEANER_KEEP_IMAGES, CLEANER_KEEP_VOLUMES).
  • BuildKit's garbage collection removes build cache only when the disk is nearly full. The cleaner generates a copy of daemon.json with one added rule, the BuildKit low-space GC rule, which acts at half the emergency level plus the root reserve. It replaces all of Docker's default GC rules, including the one that removes cache mounts, local sources and git checkouts unused for 48 hours. A customer's own builder.gc wins.
  • run.sh checks the generated daemon.json with dockerd --validate and keeps the mounted file if dockerd rejects it, supervises the cleaner (restart on failure) and gives it a bounded shutdown routine on SIGTERM. A removal in flight at SIGTERM is abandoned, and the shutdown routine has its own deadline.
  • Optional age limit, CLEANER_MAX_UNUSED_AGE_HOURS, off by default; meant for local storage.
  • Dry run, CLEANER_DRY_RUN: logs what it would remove and changes nothing but its own state file. It generates no daemon.json either, so dockerd keeps Docker's default builder GC.

Configuration

New variables, all optional, documented in dind-cleaner/README.md: CLEANER_DISABLED, CLEANER_DRY_RUN, CLEANER_SPACE_{MIN,TARGET,EMERGENCY}_FREE, CLEANER_INODES_{MIN,TARGET,EMERGENCY}_FREE, CLEANER_KEEP_IMAGES, CLEANER_KEEP_VOLUMES, CLEANER_MAX_UNUSED_AGE_HOURS, and the _SECONDS timing variables.

  • The cleaner is on unless CLEANER_DISABLED is set. No boolean is on by default.
  • The two switches are strict. CLEANER_DISABLED and CLEANER_DRY_RUN accept true, 1, false and 0. Any other value is logged and leaves the switch off.
  • The three levels of a resource are set together or not at all. With one or two set, all three fall back to the defaults, with a log line.

The old cleaner's variables are not read, and the cleaner does not mention them in its log. The chart's runtime.dind.env defaults have to be replaced, and customers who set any of these in their own values have to move:

Old variable What to set now
DISK_USAGE_THRESHOLD CLEANER_SPACE_MIN_FREE, CLEANER_SPACE_TARGET_FREE and CLEANER_SPACE_EMERGENCY_FREE, all three. The old default 0.8 corresponds to 20%, 25% and 10%. In general: min = 1 − value, target = min + 5 points, emergency = min / 2. The new levels count the space df shows as available, so on ext4 they act five points earlier than the old threshold did.
INODES_USAGE_THRESHOLD CLEANER_INODES_MIN_FREE, CLEANER_INODES_TARGET_FREE and CLEANER_INODES_EMERGENCY_FREE, percentages only, by the same rule.
CLEAN_DOCKER, DISABLE_CLEANER_AGENT CLEANER_DISABLED=true turns the cleaner off; it is on when unset. There is one cleaner now, not an agent and a shutdown cleanup.
IMAGE_RETAIN_PERIOD, VOLUMES_RETAIN_PERIOD Nothing by default: cache is kept until space is needed. CLEANER_MAX_UNUSED_AGE_HOURS sets an age limit for those who want one (recommended on local storage).
CLEAN_PERIOD_SECONDS, CLEAN_PERIOD_BUILDS Nothing. The cleaner acts on free space, not on a schedule.

What changes for operators

  • Cache is no longer removed after a fixed number of hours. Volumes sit fuller: usage (used over total) hovers around 70 to 75% on ext4 and 75 to 80% on a filesystem with no root reserve.
  • CLEANER_DRY_RUN is strict. The old cleaner took any non-empty value as a dry run. A value such as yes is now logged and is not a dry run, so the cleaner removes things.
  • Metrics. docker_volume_last_cleaned_ts, docker_volume_last_pruned_ts and docker_volume_cleaner_agent_actions_* are gone until stage 2. An alert of the form time() - docker_volume_last_cleaned_ts > X goes to no-data; it does not fire. Disk and inode usage metrics are unchanged.
  • Rollback. The new cleaner deletes the old cleaner's events/ directory at startup (not in dry run). If a runtime is rolled back to the previous image, the old shutdown cleanup finds no event history and removes every image older than IMAGE_RETAIN_PERIOD except those used in that one build. That is a one-time loss of image cache per volume.
  • Logs. The cleaner's log lines are structured (msg=evicted, start and end summaries); dind-cleaner/README.md has a section on reading them.
  • Image contents. The image now holds only run.sh, docker/ and monitor/ under /dind, not the whole repository.

Tests

  • Unit tests for every package, run by the "Unit tests" workflow (go vet, go test -race, bash -n run.sh) and by make test.
  • make lint runs golangci-lint with the module's .golangci.yml (default linters plus revive, gocritic, unparam, predeclared), over the integration tests' code too. It is not a workflow step yet.
  • An integration suite against a real daemon in a dind pod, make integration (25 tests: Docker behaviour tests, which check what the design relies on in Docker and BuildKit with the cleaner off, and lifecycle and eviction scenarios). make integration TEST_IMAGE=<image> tests an existing image and builds nothing (2774a43), and the tests also run from inside a container that only has the Docker socket (a4ed007). codefresh-io/pipelines#625 uses both to run the suite, the unit tests and make lint in the Codefresh pipeline. They ran there at a4ed007; until that PR is merged, the pipeline has to be pointed at its branch.

Documents

  • Design: docs/superpowers/specs/2026-11-27-dind-cleaner-redesign-design.md. Its "Changes after approval" section has a dated line for every decision made since, including those from the review of this PR.
  • Comparison with the old cleaner: docs/superpowers/specs/2026-11-27-dind-cleaner-redesign-comparison.md.
  • Operator documentation: dind-cleaner/README.md.

Review

The PR was reviewed at 1487be5. The findings are addressed in the 37 commits after it, up to c79b1f1:

  • Behaviour fixes: a rejected generated daemon.json no longer blocks the pod; dry run changes nothing; SIGTERM handling; idling when nothing can be evicted; volume events on their own stream; the BuildKit low-space GC rule on a volume filled into its root reserve; levels set together; USE_DIND_IMAGES_LIB with no library; bounded build-cache prunes under inode pressure; the state file's temp file; the Dockerfile.
  • Refactors, no behaviour change: one context per phase in place of three stop mechanisms; a self-contained eviction candidate and a typed tier; the tracker as a struct with the event stream as an iterator; configuration loading; readable names and is/has booleans throughout; the Go module and its README moved from cleaner/dind-cleaner to a top-level dind-cleaner directory, named like the module.
  • Decided after the review: the old variables are not read, the switch is CLEANER_DISABLED, and both switches are strict. The file dockerd starts with is called the generated daemon.json, and the rule added to it the BuildKit low-space GC rule (1abd813: names, log messages and the README only). The fact tests are called Docker behaviour tests: TestDocker… in integration/docker_behaviour_test.go, run by make docker-behaviour (bb764c8). The tests' shared setup is integration/environment_test.go, and each integration test file opens with a comment that says what it tests (17e71ec). The integration tests' IT prefix is spelled TEST: TEST_IMAGE, DIND_TEST_IMAGE, the dind-test:local image and dind-test-* resources (da08d15).

Verification

  • At c3d4068, the head: gofmt, go vet (with and without the integration tag), go test -race for every package and golangci-lint pass. The behaviour fixes in the Go code have unit tests that fail without them. run.sh and the Dockerfile are exercised by the integration run below.
  • make integration: 24 of 25 tests passed up to a4ed007; the one failure was a wrong test, rewritten in c3d4068. The pods run the image's dockerd 29.10.1. The suite ran in full on Docker Desktop (engine 29.9.3), on a local Linux dockerd 29.10.1, and at a4ed007 in Codefresh with the steps from codefresh-io/pipelines#625, with the same result each time. At c3d4068 only the rewritten test has been run, locally; it passes.
    • TestDockerBuildCacheChain failed in every run (7 of 7) up to a4ed007. It asserted that a prune with until deletes every record that Docker lists as unused and last used before the bound, but Docker keeps such a record while newer records are built on it. The cleaner does not depend on that: it skips a build-cache batch whose prune deletes nothing, at the cost of one prune call in a pass. Since c3d4068 the test checks what the cleaner relies on: the prune deletes nothing used after its bound, and the kept records are deleted with the records built on them once a bound takes those in.
    • TestDockerBuildCachePruneBound failed once in 7 runs. The newest record was listed while BuildKit still held it in use, and its ID was gone after the prune although the prune did not report deleting it. This looks like a race in the test; it is not confirmed.
    • make image could not build the test helper image on the DHI base (apk: not found). The image under test ships mkfs.ext4, so the helper is removed (836b057).

Known limits and open points

  • On local storage, a node filled by other volumes puts every pod on it into tier 2.
  • On local storage, the node agent of dind-volume-utils deletes idle volumes at the level where the cleaner starts evicting, and the cleaner checks far more often, so running builds' cache is trimmed before colder idle volumes go. What to advise operators is still open.
  • An image used only as a BuildKit FROM base emits no Docker event, so it ages as unused.
  • A restarted cleaner can replay at most Docker's last 256 events; it warns when it detects a lost window.
  • A build-cache record that newer records were built on is not pruned before them, although Docker lists it as unused. Tier 1 still queues it by its last use; its prune then deletes nothing and the batch is skipped for the pass. TestDockerBuildCacheChain covers this.
  • The + 2 second kill margin and the 0.1 second poll in run.sh are hard-coded; whether they become variables is still open.
  • Follow-ups: the venona chart variables (required for the release, see above), a golangci-lint step in the workflow, stage 2 (metrics, traces, integration tests in CI), the rootless port.

PR Comments

Add the following comments to the PR:

  • /e2e - to trigger E2E build
  • /bump patch - to bump the patch version
  • /bump minor - to bump the minor version
  • /bump major - to bump the major version

🤖 Generated with Claude Code

Security report

codefresh/dind — fixed 0 CVEs, 0 tickets

Scan

https://g.codefresh.io/build/6b0f165a098f062a3b162580

Fixed CVEs: 0

Fixed issues: 0

masontikhonov and others added 30 commits November 27, 2026 23:32
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Add a Makefile with test, image, facts and integration targets, and an
integration test harness that runs the dind image privileged on a
1G loop-mounted ext4 data root formatted by a helper image built from
the image under test. Remove the stale cleaner/dind-cleaner/test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BuildKit counts the filesystem's root reserve as free space, so the
backstop rule as first designed would act only at about 0% free as df
shows it. Confirmed against Docker 29.9.3.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Add integration tests that check, against the dind image's Docker
daemon: the event stream for container, image and volume actions;
registry digests after pull, build, import, load and push; build-cache
prune with an until filter and with a space bound; and that the
BuildKit backstop rule, with the root reserve added to minFreeSpace,
stays inert above its level and acts below it.

Add BuildKit, classic-build, build-cache and root-reserve helpers to
the harness, log cleanup failures, and keep waiting when inspecting a
starting pod fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… run

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s of removed containers

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wire the internal packages into the binary, build it from the module's
cmd and internal trees, and drop glog. An integration test runs the
binary against a real daemon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
run.sh writes the effective dockerd config with dind-cleaner daemon-config,
starts dockerd with it, supervises dind-cleaner run with restarts, and on
SIGTERM waits for the cleaner's shutdown routine within its timeout. The old
cleaner scripts and their metrics are gone. Lifecycle integration tests cover
the effective config, the disabled cleaner, restarts, shutdown and removal of
the old cleaner's files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A SIGTERM that reaches the supervisor between its loop check and the
cleaner's start is now forwarded to the new cleaner. The shutdown trap
checks /proc for the supervisor instead of kill -0, so a supervisor that
exited early (cleaner disabled) is neither waited for nor confused with a
reused PID. The lifecycle tests assert both, and that a restarted cleaner
keeps the same --pod-start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wn path

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ail it

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… vacuous checks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd Tests sections

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
masontikhonov and others added 14 commits December 1, 2026 00:59
The Docker adapter handed events to the tracker over two channels fed
by a goroutine, and the tracker drained them in three select branches,
with a nested select to tell a failed stream from one that ended.

Events now returns an iter.Seq2 that yields each event and, if the
stream breaks, the error last. The adapter's goroutine and channels are
gone, the tracker's consume is a for-range loop, and Replay ranges over
the same sequence with an until. Stopping the loop cancels the request.
A stream that ends because the cleaner is stopping is no longer logged
as failed.

The integration adapter test follows the new shape; it is compiled, not
run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- report.NothingLeft holds the policy's counts instead of six fields
  that the manager copied over one by one.
- The manager reads free space through diskStat, which logs a failure.
  "cannot read free space" was logged from seven places, three of them
  only to log the one error evict can return.
- policy.Tier2 returns its queue as one slice. It returned three, and
  its only caller joined them at once.
- docker.Client.Snapshot is built from images, volumes and buildCache,
  each with a deferred cancel like the rest of the file, where it
  repeated the timeout handling inline three times. call is now
  withTimeout, which says what it returns.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- Structs declare one field per line. Config had up to seven on one,
  and the same habit was in disk.Stat, the report's summaries and
  several small types.
- The two levelVars literals name their fields; they ended in a bare
  false and true.
- config.Load returns its notes next to the Config, as Resolve already
  did. Notes are not configuration, and the command now logs both lists
  the same way.
- A local named min no longer shadows the builtin.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The config package had four type names for two ideas. Level and Levels
are what was configured, a percentage or a size. Triple held one
resource's resolved numbers, Thresholds the resolved pair for space and
inodes, and the start summary kept a Thresholds in a field named
Levels.

Levels are now what is configured and thresholds what they resolve to:
Triple becomes Thresholds, the pair becomes DiskThresholds, and the
start summary's field is Thresholds. The log fields are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Each write created state.json.tmp-<random>. A cleaner killed between
creating that file and renaming it left it on the persistent volume,
and nothing ever removed it, so a volume could collect them over many
pods.

Saves are serialized, so one name is enough. The next write truncates
whatever a killed cleaner left under that name and renames it into
place.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- usage.Load returns nil with an error. It returned a usable log next
  to a non-nil error and the command relied on that; the fallback to an
  empty log is now the caller's, in loadUsage, with a test.
- The manager declares the Docker interface it needs, as the tracker
  already did, and the ten-method docker.API next to its implementation
  is gone.
- RemoveContainer takes RemoveContainerOptions, named as Docker's own
  client names them, in place of two adjacent booleans.
- Docker's words have names: the event types and actions come from
  moby's constants, the container state and the cache record types the
  policy compares are constants in inventory.
- removeAllContainers and removeExportImages return a plain int. They
  named the result and then returned it explicitly.
- In the command, the dispatcher is dispatch, no longer run next to
  runCommand, and the usage log is not held in a variable named log.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Two rules, applied once on the final shape of the code, tests included.

Names are words. Receivers, parameters, locals and unexported fields
that were one or two letters are spelled out: cli for the Docker
client, log for the usage log, candidate, pressure, input, snapshot,
thresholds, and manager, fake, recorder and clock in the tests. Loop
indices, counts named n, and err, ok and ctx stay. Two types changed so
that a variable does not carry its type's name: state is inputState and
loader is envLoader.

Booleans read as is or has: Config.IsEnabled and IsDryRun,
DiskThresholds.HasInodes, Volume.IsAnonymous, CacheRecord.IsInUse and
IsShared, the Pressure fields, Meta.IsFound and IsSamePod, Log.IsDirty,
Candidate.IncludesShared, and the manager's isIdle, isWoken and
wasBelowEmergency. Fields that mirror Docker's own names (All, Enabled,
Force, RemoveVolumes) keep them.

Renames only; the log output does not change. The integration tests
are renamed with the rest and compile.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The workflow runs go vet and the tests but no linter. The module gets a
.golangci.yml with the default linters plus revive, gocritic, unparam
and predeclared, over the integration tests' code too, and make lint
runs it. Errors of Close, os.Remove and printing to stdout are not
checked, as usual, and a test helper may take *testing.T before its
context.

What it found is fixed: a test helper's parameter named min, a
parameter that was always 1, and an event sequence ranged without
looking at its error. The workflow step itself is left to the CI work.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ADD . /dind put the Go sources and tests, the Makefile and whatever else
the build context held into the production image. At run time the image
needs run.sh, docker/ and monitor/, so those are copied by name. The old
cleaner's scripts, which were the reason for copying everything, are
gone.

.git, .github and the top-level Markdown files are left out of the
build context as well.

Not built here: the base images are private. make integration builds
the image and covers it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The cleaner mapped DISK_USAGE_THRESHOLD and INODES_USAGE_THRESHOLD to
levels, let DISABLE_CLEANER_AGENT without CLEAN_DOCKER turn it off,
ignored the period and retain variables, and reported all of them on
one startup log line. About a third of the config package existed for
that.

The image is only released together with the chart, which sets the new
variables in its default values and documents the change. Under that
chart the mapping could never apply. And once the chart stops setting
CLEAN_DOCKER, the off switch would have turned the whole cleaner off
for someone who had only disabled the old mid-run agent.

None of the eight variables is read any more, and none is mentioned in
the log. An unrecognized CLEANER_ENABLED value now leaves the cleaner
on with a note; it used to hand the decision to the old variables. The
README's section on them and the design's table are gone; the design
records the decision.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
CLEANER_ENABLED was a boolean that is true by default. A boolean
variable should be off when unset, so the switch is named for what
setting it does: CLEANER_DISABLED, off by default. Config.IsEnabled is
Config.IsDisabled, for the same reason.

It is parsed like the other switch, CLEANER_DRY_RUN: on for any
non-empty value other than false or 0. The note for an unrecognized
value goes with that. CLEANER_ENABLED is not read; it was never
released.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
CLEANER_DISABLED and CLEANER_DRY_RUN were on for any non-empty value
other than false or 0, so a mistyped false turned the cleaner off.

Both now accept true, 1, false and 0, ignoring case and surrounding
spaces. Any other value is noted in the log and leaves the switch off.
For dry run this cuts the other way too: CLEANER_DRY_RUN=yes, which the
old cleaner took as a dry run, is no longer one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The module sat in cleaner/dind-cleaner because on master it was one Go
helper among the bash cleaner's scripts. The scripts are gone, so
cleaner/ held nothing but the module and its README.

Both now live in dind-cleaner, named like the module. The Dockerfile,
the Makefile, the unit-test workflow and the Dependabot configuration
point at the new path. The module path and the binary's name do not
change.

The image was not built here; make integration is the first check of
the new COPY paths.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@codefresh-git-integration

Copy link
Copy Markdown

/e2e

masontikhonov and others added 4 commits December 1, 2026 02:41
…C rule

"Effective config" did not say where the file comes from, and was untrue
when dockerd rejects it and starts with the mounted file. "Backstop" named
the rule's role in the design, not what it does.

The log messages and the README section heading change with the names.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
"Fact" was the design's shorthand for a fact about Docker the cleaner
relies on, and said nothing to a reader of the tests. The file, the test
names, the helper and the make target (now docker-behaviour) are renamed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
harness_test.go becomes environment_test.go and TestHarnessSmoke becomes
TestEnvironmentSmoke, matching the Env type. Each integration test file
now opens with a comment that says what it tests.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
IT stood for "integration test" and was never spelled out. The Makefile
variables, the environment variables the tests read, the local image tags
and the names of the Docker resources the tests create now say TEST.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@codefresh-git-integration

Copy link
Copy Markdown

/e2e

The helper image was built with `apk add e2fsprogs` on top of the image
under test, which fails since the base became a DHI image with no apk:
`make image` could not finish. The image already ships mkfs.ext4, so the
helper image, TEST_MKFS_IMAGE and DIND_TEST_MKFS_IMAGE are removed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@codefresh-git-integration

Copy link
Copy Markdown

/e2e

masontikhonov and others added 5 commits December 1, 2026 03:46
With TEST_IMAGE set, `make integration` and `make docker-behaviour` run
against that image and build nothing. CI uses it to test the image the
pipeline has already built. Without it they build dind-test:local as
before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The tests reached each pod's Docker API on a port published on the
daemon's loopback address, which a test process in a container of the
same daemon cannot reach. In that case the container now joins the test
network and uses the pod's address there, so the suite runs in a CI step
that only has the Docker socket.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
TestDockerBuildCacheChain asserted that a bounded prune deletes every
record listed as unused and last used before the bound. Docker keeps
such a record while newer records are built on it, so the test failed
in every run. The cleaner does not depend on that: it skips a batch
whose prune deletes nothing.

The test now checks the two things the cleaner relies on: a bounded
prune deletes nothing used after its bound, and the kept records go
with the records built on them once a bound takes those in.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
In the integration tests a Pod was a privileged container of the image
under test, which is not what the word says. It is now DindContainer,
started with StartDindContainer, and its Docker name is
dind-test-container-<id>-<n>.

"Pod" stays where it is the cleaner's own term: the --pod-start flag,
the pods file and the state file's podStart.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The build stage copies dind-cleaner/cmd and dind-cleaner/internal whole,
so a change to a unit test re-ran go build although the binary cannot
change. .claude holds local tool settings that no build needs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@codefresh-git-integration

Copy link
Copy Markdown

/e2e

@codefresh-git-integration

Copy link
Copy Markdown

/e2e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant