This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
Expose HasRegistry
bool to builder plugins, Docker doesn't pull if it doesn't have to
#1198
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.
The main motivation for this PR is to enable a workflow where Waypoint is using an externally built image (such as from CI) without requiring
docker
or any privileges/namespaces even in a Dockerless environment (i.e. withimg
).Since
img
still requires user namespaces and user namespaces aren't enabled by default on most hosted K8S platforms, this enables a working Waypoint experience if the above two conditions are met, guaranteed.To make this work, I've exposed a named variable
HasRegistry
that builders can opt-in for (via the typical argmapper DI stuff, see the Docker implementation in this PR) to determine if there is a registry configured.For Docker, if the CEB injection is disabled AND there is no registry, we don't pull at all.