Repository navigation
Conversation
Author
|
Depends on #2730 |
herder
force-pushed
the
skip-vendor-keychains
branch
from
November 2, 2026 19:35
7a5ef51 to
1b219d8
Compare
When the credentials pack resolves for CNB_REGISTRY_AUTH cover the registry of every image a phase uses, also set CNB_REGISTRY_AUTH_KEYCHAIN_SKIP_AMAZON and _AZURE. The lifecycle's vendor keychains could only look up the same credentials again, and the ECR and ACR helpers do so slowly, via instance metadata: about 15s per analyzer and exporter run when the images are on ECR. If any registry is not covered, the vendor keychains stay on, so builds that rely on them (e.g. an instance role without docker login) keep working. The log redaction now matches CNB_REGISTRY_AUTH= exactly, so the skip variables show up in verbose output instead of as a second redacted CNB_REGISTRY_AUTH. Resolves buildpacks#2731 Signed-off-by: Niklas Herder <niklas.herder@gmail.com>
herder
force-pushed
the
skip-vendor-keychains
branch
from
November 16, 2026 14:49
1b219d8 to
f686b92
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the credentials pack puts in
CNB_REGISTRY_AUTHcover the registry of every image a phase uses, pack now also setsCNB_REGISTRY_AUTH_KEYCHAIN_SKIP_AMAZON=trueandCNB_REGISTRY_AUTH_KEYCHAIN_SKIP_AZURE=true(added in buildpacks/lifecycle#1315). In that case the lifecycle's vendor keychains can only look up the same credentials again. They do it eagerly for every image, and from inside the phase container the ECR and ACR helpers wait on instance metadata before giving up. That costs about 15s per analyzer and exporter run when the images are on ECR, or minutes on ACR (buildpacks/lifecycle#1007).If pack has no credentials for any one of the registries, the vendor keychains stay on. Builds that depend on them, such as an instance role with no
docker login, behave as before.WithRegistryAccessnow takes the images and decides; the four call sites pass the images they already resolve credentials for. The verbose-log redaction now matchesCNB_REGISTRY_AUTH=exactly, so the skip variables appear in the output. Before, each one showed up as an extraCNB_REGISTRY_AUTH=<redacted>.Output
pack build --publish --verbose, untrusted builder (5 phases), run image on ECR via a registry mirror, app and cache images in a password-protected registry; same build both times with the stock lifecycle 0.21.26.Before
After
Earlier, with a lifecycle image that had the variable baked in, an otherwise identical warm build went from 71s to 39s.
Documentation
Related
Resolves #2731
Tested:
go test ./internal/...passes, with new tests for the covered, partly-covered and no-credentials cases and for the log output. Inpkg/client, one quiet-mode test fails locally because my Docker daemon uses containerd image storage and pack prints its warning; that's unrelated to this change. golangci-lint v2.0.2 reports the same typecheck errors onmainhere, so I'm relying on CI for lint, and for the acceptance tests, which I didn't run.