Repository navigation
Build the box environment in the core, and reach the proxy control channel by URL - #113
Merged
Merged
Conversation
…annel by URL The Docker code built the environment of a box: it put the proxy URL, the CA variables and TERM next to the placeholders that the core gave it, and it made the proxy URL from the alias and the port settings. On another runtime, this code had to be written again. The core now builds the full environment as a plain record in boxEnv, and the Docker code only converts it to its KEY=value list. The proxy URL comes from the runtime through proxyUrl, because only the runtime knows how a box reaches the proxy. The control channel of the proxy was reached at the container name EGRESS_PROXY_CONTAINER and the port EGRESS_CONTROL_PORT. On a runtime without container names, this address has no meaning. It is now the URL EGRESS_CONTROL_URL, with the same default address. Part of splitbrain#109
4 of 9 tasks
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.
Part of #109 (step 2).
Changes
boxEnvof the neworchestrator/src/boxenv.ts:the harness variables, the credential placeholders, the git identity,
TERM, the proxy variables and the CAvariables. Empty values are dropped there. Before,
credentialEnvindocker.tsbuilt the placeholders and theidentity, and
boxEnvindocker.tsadded the rest and made theKEY=valuelist.createContainernow only convertsthe record to the list. The field
caCertificateofCreateContainerSpecis gone; the CA is part of the record.proxyUrl(cfg)indocker.tsmakes it fromEGRESS_PROXY_ALIASandEGRESS_PROXY_PORT. The core passes it intoboxEnv.EGRESS_CONTROL_URL(defaulthttp://boxes-egress-proxy:3129, must be anhttp:URL). Before, it was built fromEGRESS_PROXY_CONTAINERandEGRESS_CONTROL_PORT.EGRESS_CONTROL_PORTis gone.EGRESS_PROXY_CONTAINERstays for the attachment of the proxyto the box networks and for the image footer.
doc/environment.mddescribesEGRESS_CONTROL_URLinstead ofEGRESS_CONTROL_PORT.Breaking change: a deployment that sets
EGRESS_CONTROL_PORTmust setEGRESS_CONTROL_URLinstead. The oldvariable is ignored without an error.
Tests
tsc --noEmitis clean, 881 tests passed, 1 skipped (as before). TheboxEnvtests moved fromdocker.test.tstoboxenv.test.tswith the same assertions. The egress tests setEGRESS_CONTROL_URL; before, theyset
EGRESS_PROXY_CONTAINERto127.0.0.1to reach a local test server. The config test checks the new default.https://x:1and a non-URL are rejected, an empty value gives the default.Not tested against a real Docker daemon or a real proxy.
Notes for the next steps
Runtimeinterface.proxyUrl(cfg)indocker.tsbecomesRuntime.proxyUrl().EGRESS_PROXY_ALIASand
EGRESS_PROXY_PORTare then details of the Docker runtime.boxEnvinboxenv.tsis the record of section 7 ofthe concept; the Docker runtime converts it with the one line in
createContainer.EGRESS_PROXY_CONTAINERis usedby the proxy attachment in
docker.tsand the image footer inimages.ts; both move behind the interface.boxEnvbecomes theenvlist of the pod spec without a change. The URLEGRESS_CONTROL_URLthen names the proxy Service, for examplehttp://boxes-egress-proxy:3129. The orchestrator joinsthe path with
new URL(path, EGRESS_CONTROL_URL), so the URL must have no path of its own.