Skip to content

Bump go-containerregistry to v0.21.7 to fix OOM during image extract#464

Merged
Julian Gutierrez Oschmann (juli4n) merged 2 commits into
agent-substrate:mainfrom
dberkov:bump-go-containerregistry-v0.21.7
Jul 20, 2026
Merged

Bump go-containerregistry to v0.21.7 to fix OOM during image extract#464
Julian Gutierrez Oschmann (juli4n) merged 2 commits into
agent-substrate:mainfrom
dberkov:bump-go-containerregistry-v0.21.7

Conversation

@dberkov

@dberkov Dmitry Berkovich (dberkov) commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Bumps github.com/google/go-containerregistry v0.21.5 → v0.21.7. Phase 0 of #463.

v0.21.6 fixed the memory spike in mutate.Extract described in #120 (upstream fix: google/go-containerregistry#2190, merged as google/go-containerregistry@38d6e4087c): extraction is now refactored into a per-layer extractLayer function, so each layer's decompressor and HTTP response body are closed as soon as that layer is processed, instead of all being held open via deferred Close calls until the entire (multi-GB) extraction completes. atelet's pull path goes through memorypullcache.Fetchmutate.Extract, so this directly caps its extract-time memory.

Note this is only interim relief: #437's unbounded cache retention is untouched and is addressed by the redesign in #463.

Changes

  • go-containerregistry v0.21.5 → v0.21.7, plus required transitive bumps: docker/cli, klauspost/compress, golang.org/x/sync, golang.org/x/sys
  • go mod tidy + go mod vendor; the containerd/stargz-snapshotter/estargz vendor tree drops out (upstream removed the estargz integration; nothing in substrate used it), along with vbatts/tar-split and mitchellh/go-homedir

Testing

  • go build ./... passes
  • Full go test ./... passes
  • Verified the layer-close fix is present in the vendored pkg/v1/mutate/mutate.go

Fixes #120

🤖 Generated with Claude Code

@juli4n

Copy link
Copy Markdown
Collaborator

It looks like you need to update licenses (./hack/update/licenses.sh).

@juli4n

Copy link
Copy Markdown
Collaborator

For the record, it would be good to also include a reference to the PR in go-containerregistry that fixes the described issue.

@dberkov

Copy link
Copy Markdown
Collaborator Author

Thanks Julian Gutierrez Oschmann (@juli4n) — both addressed: LICENSES regenerated via ./hack/update/licenses.sh in 4878555 (the bump dropped estargz/tar-split/go-homedir from vendor), and the PR description now references the upstream fix (google/go-containerregistry#2190, merged as 38d6e4087c, first released in v0.21.6).

mutate.Extract no longer holds every layer's decompressor and HTTP
body open until the whole extraction finishes (fixes agent-substrate#120's memory
spike on multi-GB images. Phase 0 of agent-substrate#463.

Also pulls transitive bumps (docker/cli, klauspost/compress, x/sync,
x/sys) and drops the now-removed estargz vendor tree (unused).

EOF
)
go-containerregistry v0.21.7 no longer depends on stargz-snapshotter/estargz,
tar-split, or go-homedir; hack/update/licenses.sh removes their entries so
hack/verify/licenses.sh passes.
@juli4n
Julian Gutierrez Oschmann (juli4n) merged commit 228fde4 into agent-substrate:main Jul 20, 2026
11 checks passed
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.

atelet OOMs on multi-layer multi-GB images

2 participants