-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More robustly handle values passed to --distro and --release #977
More robustly handle values passed to --distro and --release #977
Conversation
...unless the selected distro matches the host system. containers#977
Having a list of supported distributions in the manual has been long overdue. Complementing it with the expected formats should make lives of users a bit easier. containers#977
…rors Using a non-supported distribution via `--distro` resulted in a silent fallback to the Fedora image which confuses users. When a faulty release format was used with `--release` a message without any hint about the correct format was shown to the user. This separates distro and release parsing into two chunks that have greater control over error reporting and provides more accurate error reports for the user. Fixes containers#937 containers#977
Found while working on containers#937 containers#977
f68d253
to
2ec7556
Compare
Build failed.
|
...unless the selected distro matches the host system. containers#977
Having a list of supported distributions in the manual has been long overdue. Complementing it with the expected formats should make lives of users a bit easier. containers#977
…rors Using a non-supported distribution via `--distro` resulted in a silent fallback to the Fedora image which confuses users. When a faulty release format was used with `--release` a message without any hint about the correct format was shown to the user. This separates distro and release parsing into two chunks that have greater control over error reporting and provides more accurate error reports for the user. Fixes containers#937 containers#977
Found while working on containers#937 containers#977
2ec7556
to
d13df7a
Compare
Build failed.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reminds me of commit fd756089efb89f05.
I have been having doubts about it, because splitting ResolveContainerAndImageNames
into two public functions pushes the burden on the callers. The callers now need to carefully call the split functions in the right order, which opens the door for mistakes.
I think a good compromise would be to restore ResolveContainerAndImageNames
as the single public API, but internally split it into smaller private functions. It would keep things simple for both the callers and the implementation.
Ultimately, the distro
, release
, image
and container
values are very tightly related here. So, we need a public API to which we feed the input values, and get back the resolved values, without worrying about the intricacies involved.
...unless the selected distro matches the host system. containers#977
Having a list of supported distributions in the manual has been long overdue. Complementing it with the expected formats should make lives of users a bit easier. containers#977
…rors Using a non-supported distribution via `--distro` resulted in a silent fallback to the Fedora image which confuses users. When a faulty release format was used with `--release` a message without any hint about the correct format was shown to the user. This separates distro and release parsing into two chunks that have greater control over error reporting and provides more accurate error reports for the user. Fixes containers#937 containers#977
Found while working on containers#937 containers#977
I merged the updates to the manuals in #986 after applying the above tweaks. |
Thanks! |
Build succeeded.
|
…rors Using a non-supported distribution via `--distro` resulted in a silent fallback to the Fedora image which confuses users. When a faulty release format was used with `--release` a message without any hint about the correct format was shown to the user. This separates distro and release parsing into two chunks that have greater control over error reporting and provides more accurate error reports for the user. Fixes containers#937 containers#977
Found while working on containers#937 containers#977
cf90340
to
1d641e3
Compare
Build failed.
|
…rors Using a non-supported distribution via `--distro` resulted in a silent fallback to the Fedora image which confuses users. When a faulty release format was used with `--release` a message without any hint about the correct format was shown to the user. This separates distro and release parsing into two chunks that have greater control over error reporting and provides more accurate error reports for the user. Fixes #937 #977
The idea of splitting ResolveContainerAndImageNames into two public functions didn't turn out to be so useful [1]. 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, but internally split it into smaller private functions, if necessary. It would keep things simple for both the callers and the implementation. Note that this commit doesn't include the private split, but leaves that as a future exercise. This reverts commit fd75608. [1] containers#977
The idea of splitting ResolveContainerAndImageNames into two public functions didn't turn out to be so useful [1]. 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, but internally split it into smaller private functions, if necessary. It would keep things simple for both the callers and the implementation. Note that this commit doesn't include the private split, but leaves that as a future exercise. This reverts commit fd75608. [1] containers#977
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
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
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
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
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
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
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
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
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
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time has only made me lean further towards my earlier comment. We should re-unify the resolution of container
, distro
, image
and release
, and not split it even further.
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
This change is rather big despite my efforts to keep it as small as possible. The handling needed some separation and along the way I noticed some possible problems or duplication.
Read commits for detailed information.
Fixes #937