-
Notifications
You must be signed in to change notification settings - Fork 667
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
SONiC installer - check new image type before checking installed version and small improvements #1196
base: master
Are you sure you want to change the base?
Conversation
Is there a problem with the current behavior? If a image with the same version as the image file trying to be installed, the image is not installed, but that image version is set to the new default version. Thus, it doesn't matter if the image type is incorrect, it will not be installed because that version is already installed. What was the issue? |
In the sequence of checks before the installation, shouldn't the type verification happen before the OS version verification? |
It wouldn't hurt, and arguably may be more correct. My original intention was to first check if the image version is already installed, because if the image version is already installed, it doesn't matter if the image type is incorrect, because we don't need to install the image. However, we will ensure that image is set to the default version, thus the end result is that the image is installed (because it already was) and is set to the default. Technically the same result as a successful installation, so I don't consider it a failure.
If the version of the image isn't already installed on the device, the operation will error out. For the test, are you trying to install the same version image which is already installed? |
I can close the issue, and undo changes here. But still the message needs to be corrected where string substitution does not happen as expected, and hence we get the below: |
For now, can you open a small PR to fix the string formatting? |
Sure, created a new PR for that - #1197 |
- What I did
SONiC master and 201911 images check the OS version of the new image before checking new image type (ABOOT/ONIE).
Ideally, image type should be verified first and then proceed with checking the OS version along with setting default OS version.
Fixes #1195
Before: (note that type
bin
is incompatible onaboot
platform. But the installation did not give an error:Now:
- How I did it
Check compatibility of new image type before verifying the installed version.
Fix error message.
- How to verify it
Verified on a
aboot
platform and the incompatible image installation fails with an error instead of a success message.- Previous command output (if the output of a command-line utility has changed)
- New command output (if the output of a command-line utility has changed)