Repository navigation
Re-unify container & image name resolution and ensure that the 'distro' CLI and config file options are valid - #1080
Conversation
|
Build failed. ❌ unit-test RETRY_LIMIT in 6m 37s |
98103aa to
1eb1fa2
Compare
|
Build failed. ✔️ unit-test SUCCESS in 6m 39s |
1eb1fa2 to
0ff3964
Compare
|
Build failed. ✔️ unit-test SUCCESS in 7m 07s |
0ff3964 to
cce7674
Compare
|
Build succeeded. ✔️ unit-test SUCCESS in 6m 55s |
1cdd5b7 to
e627c98
Compare
|
Build succeeded. ✔️ unit-test SUCCESS in 7m 27s |
e627c98 to
5c22514
Compare
|
Build succeeded. ✔️ unit-test SUCCESS in 7m 54s |
5c22514 to
38aa6db
Compare
The idea of splitting ResolveContainerAndImageNames into two public functions [1] didn't turn out to be so useful [2]. Splitting things even further might make it worse. A better approach might be to (re-)unify the code further. This is the first step towards that. This reverts the following commits: * 5c8ad7a * 02f45fd * 8b6418d ... but retains the test cases that were not tied to the changes in those commits. [1] Commit fd75608 containers#828 containers#838 [2] containers#977 containers#937 containers#1080
The idea of splitting ResolveContainerAndImageNames into two public functions [1] didn't turn out to be so useful [2]. It pushed the burden on the callers, who needed to carefully call the split functions in the right order, because the container, distro, image and release values are very tightly related. This opens the door for mistakes. A better approach would be to restore ResolveContainerAndImageNames as the single public API. If necessary it could be internally split into smaller private functions. It would keep things simple for the callers. Note that this commit doesn't include the private split. If necessary, it can be done in future. This reverts commit fd75608. [1] Commit fd75608 containers#828 containers#838 [2] containers#977 containers#937 containers#1080
The terms 'default' and 'fallback' are used to mean very specific things in this context. The 'default' values are those that are used when the 'create', 'enter' and 'run' commands were used without any option. These values are picked to match the host operating system. However, if there's no supported Toolbox image matching the host operating system, and no options were provided to the 'create', 'enter' and 'run' commands, then the 'fallback' values are used as a last resort. Consistently using this terminology leads to a clear mental model and makes the code easier to read. This rough arrangement of the code was already being used for 'release', and has now been been extended to 'container name prefix' and 'distro'. The suffix for the 'fallback' values was simplified to 'Fallback', instead of 'DefaultFallback'. containers#937 containers#1080
Currently, if an invalid or unsupported string is specified as the distro on the command line or in the configuration file, then it would silently fallback to Fedora. This shouldn't happen. It should only fallback to Fedora when no distro was specified and there's no supported Toolbox image matching the host operating system. If a distro was explicitly specified then it should either be supported or it should error out. The test cases were resurrected from commit 8b6418d. containers#937 containers#1080
|
Build succeeded. ✔️ unit-test SUCCESS in 7m 46s |
38aa6db to
df7e01d
Compare
|
Build succeeded. ✔️ unit-test SUCCESS in 7m 05s |
This reverts #977 to address the problems with it with the intention to fix the first part of #937
#937 points out several problems. This pull request only attempts to ensure that Toolbx errors out when the user specifies an invalid
distro, instead of falling back to Fedora. It doesn't try to improve the error reporting for a missing or invalidrelease.