Skip to content

feat: report push phase transitions during OCI image export#2797

Open
markphelps wants to merge 3 commits intomainfrom
mphelps/push-phase-progress
Open

feat: report push phase transitions during OCI image export#2797
markphelps wants to merge 3 commits intomainfrom
mphelps/push-phase-progress

Conversation

@markphelps
Copy link
Contributor

@markphelps markphelps commented Mar 3, 2026

Summary

  • During OCI push, the Docker image export phase (docker save → temp tarball) was completely silent — the user saw nothing while potentially large images were exported to disk before chunked upload began.
  • Extends PushProgress with a Phase field so phase transitions (exporting → pushing) flow through the existing single callback, and the CLI displays status messages like Exporting image from Docker daemon... during the silent export phase.

Design

Rather than adding a separate PhaseFn callback and ImagePhaseFn option (which would double the callback surface), PushProgress now carries two kinds of updates through one channel:

Update type Phase LayerDigest / byte fields
Phase transition set (e.g. "exporting") zero/empty
Byte progress empty set (per-layer upload progress)

The CLI dispatches on prog.Phase != "" to show status-only lines vs progress bars — both rendered through the existing ProgressWriter.

Changes

  • pkg/model/push_helpers.go — Added PushPhase type with PushPhaseExporting and PushPhasePushing constants; extended PushProgress with Phase field
  • pkg/model/image_pusher.go — Emit phase callbacks via existing progressFn at export start and push start
  • pkg/model/pusher.go — Updated PushOptions.ImageProgressFn docs to reflect unified contract
  • pkg/cli/push.go — Handle phase updates in the progress callback, showing status lines during export
  • pkg/model/image_pusher_test.go — Updated test to verify both phase transitions and byte progress

During OCI push, the Docker image export phase (docker save → temp
tarball) was completely silent — the user saw nothing while potentially
large images were exported. This adds phase reporting through the
existing PushProgress callback so the CLI can display status messages
during the export.

Rather than adding a separate callback, PushProgress is extended with
a Phase field. Phase-only updates (Phase set, byte fields zero) signal
transitions between exporting and pushing; byte-progress updates
(Phase empty) report per-layer upload progress as before. This keeps
a single callback contract for all push progress.
@markphelps markphelps requested a review from a team as a code owner March 3, 2026 18:08
Phase transitions (exporting, pushing) now print via console.Infof for
pretty CLI formatting, while per-layer progress bars continue using the
JSON progress writer.
@markphelps markphelps requested a review from michaeldwan March 4, 2026 16:07
@michaeldwan michaeldwan added this to the 0.18.0 milestone Mar 5, 2026
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.

2 participants