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

os.proto Install RPC with incorrect version #43

Open
Reshad-Rahman opened this issue Nov 2, 2020 · 1 comment
Open

os.proto Install RPC with incorrect version #43

Reshad-Rahman opened this issue Nov 2, 2020 · 1 comment

Comments

@Reshad-Rahman
Copy link

Consider a client trying to install an OS image which is the same version as the image running on the target device:

  1. If the client does not provide the version, the target device aborts the RPC and returns INSTALL_RUN_PACKAGE as mentioned here
  2. If the client provides the correct version (i.e. the one running on the target), the target device returns Validated immediately (i.e. no image transfer takes place)
  3. If the client provides an incorrect version (i.e. NOT the one running on the target), it is not clear from the os.proto specification what the device should return.
@samribeiro samribeiro self-assigned this Nov 3, 2020
@samribeiro
Copy link
Member

1 - return INSTALL_RUN_PACKAGE;

2 - In this case, the version value in the package does not matter. The package never gets to be transferred. If the device is running 17.10.1, then it must have 17.10.1 installed. So Validated is the correct response to the version field being 17.10.1.

3 - If the client provides an incorrect version field or one that does not match the actual package's version, it is in its essence causing a force transfer. Because this is a force transfer, the right response is INSTALL_RUN_PACKAGE.

I believe you have spotted a potential ambiguity that needs to be made clearer. Why would 2) return Validated, but 1) and 3) return INSTALL_RUN_PACKAGE? The essence of this is that in situation 2) we never go beyond the question: "do you have this OS version?" by virtue of using the version field. While situations 1) and 3) inherently skip this question and go directly to the intrusive task of transferring the OS image to be written in the Target. This intrusion must return INSTALL_RUN_PACKAGE error because we must not touch an OS image that is currently running.

Proto documentation needs to be updated to make this clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants