fix(image): read the pushed digest from the kaniko log #2

Merged
Defame1297 merged 2 commits from fix/image-digest-after-build into main 2026-10-25 10:40:43 +00:00
Owner

Problem

The first image.yml runs on main built and pushed git.rkdr.net/mortis/molecule-ubuntu2404 (tags sha-dcfcbd105e47, latest), then failed on read -r digest < /kaniko/digest. The executor replaces the job container's filesystem with the built image and removes /kaniko, so the digest file and the credential-method file are gone by then.

Change

  • Read the digest from kaniko's Pushed <image>@sha256:<digest> log line into a shell variable (bash builtins only, since the filesystem is the built image), and validate it against ^sha256:[0-9a-f]{64}$.
  • Fail with a clear error if no digest was found; propagate the executor's exit status with wait.
  • Drop the --digest-file flag and the credential-method echo (the prepare step already logs the credential in use).

Verification

CI here covers lint only. image.yml does not run on pull requests, so the real check is a workflow_dispatch run on main after merge. Re-pushing identical layers is harmless.

🤖 Generated with Claude Code

## Problem The first `image.yml` runs on `main` built and pushed `git.rkdr.net/mortis/molecule-ubuntu2404` (tags `sha-dcfcbd105e47`, `latest`), then failed on `read -r digest < /kaniko/digest`. The executor replaces the job container's filesystem with the built image and removes `/kaniko`, so the digest file and the credential-method file are gone by then. ## Change - Read the digest from kaniko's `Pushed <image>@sha256:<digest>` log line into a shell variable (bash builtins only, since the filesystem is the built image), and validate it against `^sha256:[0-9a-f]{64}$`. - Fail with a clear error if no digest was found; propagate the executor's exit status with `wait`. - Drop the `--digest-file` flag and the credential-method echo (the prepare step already logs the credential in use). ## Verification CI here covers lint only. `image.yml` does not run on pull requests, so the real check is a `workflow_dispatch` run on `main` after merge. Re-pushing identical layers is harmless. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Claude added 2 commits 2026-10-25 10:39:21 +00:00
The first run on main built and pushed the image, then failed on
`read -r digest < /kaniko/digest`: the executor replaces the job
container's filesystem with the built image and removes /kaniko, so the
digest file and the credential-method file are gone by then.

Take the digest from the "Pushed <image>@sha256:<digest>" log line into a
shell variable, validate its shape, and drop the credential-method echo
(the prepare step already logs the credential in use).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
fix(image): ignore anything after the 64 hex digits of the logged digest
Lint / lint (pull_request) Successful in 1m24s
Build / build (pull_request) Successful in 49s
1ecd060239
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Defame1297 approved these changes 2026-10-25 10:40:33 +00:00
Defame1297 merged commit 3bac7a4a09 into main 2026-10-25 10:40:43 +00:00
Defame1297 deleted branch fix/image-digest-after-build 2026-10-25 10:40:44 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#2