Skip to content
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

Merged
merged 8 commits into from
Mar 18, 2021

Conversation

mitchellh
Copy link
Contributor

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. with img).

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.

Copy link
Contributor

@evanphx evanphx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I do like love pushing the envelope, probably the arg should be a named structure.

builtin/docker/pull/builder.go Outdated Show resolved Hide resolved
@mitchellh
Copy link
Contributor Author

So turns out this doesn't work at all with real plugins cause we don't support named primitive types across the plugin boundary. Working on that now in waypoint-plugin-sdk.

@mitchellh mitchellh merged commit eef49a9 into main Mar 18, 2021
@mitchellh mitchellh deleted the feature/registry-aware branch March 18, 2021 22:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants