-
Notifications
You must be signed in to change notification settings - Fork 185
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
feat: allow a target to set offline assigned distribution set #1620
base: master
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
b9b1ed6
to
3cc5f12
Compare
Signed-off-by: Florian Bezannier <florian.bezannier@hotmail.fr>
3cc5f12
to
dcf589b
Compare
@avgustinmm would you be able to review this PR soon ? |
...awkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/DeploymentManagement.java
Outdated
Show resolved
Hide resolved
...t-repository-api/src/main/java/org/eclipse/hawkbit/repository/DistributionSetManagement.java
Outdated
Show resolved
Hide resolved
...t-repository-api/src/main/java/org/eclipse/hawkbit/repository/DistributionSetManagement.java
Outdated
Show resolved
Hide resolved
...jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaControllerManagement.java
Show resolved
Hide resolved
...jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaControllerManagement.java
Outdated
Show resolved
Hide resolved
/** | ||
* Allow a target to declare running distribution set version | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) |
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.
could use lombok annotations already available hawkbit wide
@Data@ToString
@ToString
and to remove some boilerplate code
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.
Lombok isn't in hawkbit-ddi-api dependencies, you want to add it ?
+ DdiRestConstants.INSTALLED_BASE_ACTION, consumes = { | ||
MediaType.APPLICATION_JSON_VALUE, DdiRestConstants.MEDIA_TYPE_CBOR }) | ||
ResponseEntity<Void> setAsssignedOfflineVersion(@Valid DdiAssignedVersion ddiAssignedVersion, |
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.
not sure about if the enpoint shalle be installed_base_action ...
have to think over it
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.
Have you an answer now ? So we can freeze the API definition.
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.
Not yet. We are up to release 0.5.0. After that we will have enough time to think about that DDI API change ...
hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/SpPermission.java
Outdated
Show resolved
Hide resolved
...jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaDeploymentManagement.java
Outdated
Show resolved
Hide resolved
@flobz thanks for your contribution. By coincidence, I was reviewing the PR at the same time you wrote. Though I added many comments into my review they are, in general, mostly related to same thing - not exposing backend management service methods to controller permissions. I have some questions regarding the motivation of the PR. If the target requests a rollback I suppose the scenario would be something like:
However, I'm not sure how "allow to know a target version before first update (eg: after flashing)" would work? I'm still not sure these are real usecases. Isn't it up to a backend service, responsible for device management, to provision installed ds info and to "realize" error states and to launch recover/rollback actions? And finally - since this is an DDI API method it shall be very stable so it is very important the path of the method. At the moment I'm not sure installedBase is a proper path. |
In the case where no version is assigned to the target because we don't want to update it, it's nice to know it's version no ?
In my opinion a target should be autonomous. We use rauc with two slot so, for example if one slot is corrupt target should automatically switch to the other slot and tell hawkbit that the installed version isn't anymore the version on the corrupt slot but version on the healthy slot. |
Seconded - I'm also using a 2-partition layout for updates, as well as a recovery mode that flashes a "golden image" to both partitions in certain scenarios. It's important for the device to be the source of truth because even the best backend can't handle all error cases. In the past week I've encountered two issues where the device was on a different version than hawkbit thought
|
Hello,
This PR allows a target to update it's assigned version (fix: #446).
It's relies on #563 but allow a target to do that it self instead of using Management API.
why :
Related discussion:
#242