-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix: store state in deployment data #76
fix: store state in deployment data #76
Conversation
@@ -518,7 +518,6 @@ mender_client_initialization_work_function(void) { | |||
|
|||
/* Delete pending deployment */ | |||
mender_storage_delete_deployment_data(); |
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.
We discussed should call the data update data, it's no longer just a deployment info.
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.
Right, you think I should rename everything that's named deployment data
to update data
(including mender-deployment-data.c etc.?)
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.
We discussed should call the data update data (...)
To be fair with Daniel in the ticket we wrote "consider renaming..."
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.
Yeah, I but IIRC we discussed it on Slack or somewhere else too...
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.
I can do it in a separate PR
core/src/mender-client.c
Outdated
@@ -1040,9 +1048,8 @@ mender_client_update_work_function(void) { | |||
* verification should happen anyway, the callback in that | |||
* state should be able to see if things went well or | |||
* wrong. */ | |||
mender_storage_save_update_state(MENDER_UPDATE_STATE_VERIFY_REBOOT, mender_update_module->artifact_type); | |||
mender_deployment_data_set_state(mender_client_deployment_data, MENDER_UPDATE_STATE_VERIFY_REBOOT); |
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.
What's the point of setting the state here again?
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.
According to the comment above it's to ensure that reboot verification happens in case of a crash in the reboot-callback, but it's also set at the start of the code, so I guess this is unnecessary?
a5527fb
to
b8fad25
Compare
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.
It looks good to me - it seems like all my concerns were addressed. Thanks!
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.
Looks good to me otherwise.
* verification should happen anyway, the callback in that | ||
* state should be able to see if things went well or | ||
* wrong. */ | ||
mender_storage_save_update_state(MENDER_UPDATE_STATE_VERIFY_REBOOT, mender_update_module->artifact_type); |
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.
I think we still want do do set_and_store_state()
here iff there is a reboot callback. If there isn't, it will be called by NEXT_STATE
below anyway. It just wouldn't be called twice in such a case.
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.
I moved it outside of the if-statement, but I moved it back now, because it's stored in NEXT_STATE
as you said
b8fad25
to
b020054
Compare
They are passed in as NULL and populated later. Ticket: None Signed-off-by: Daniel Skinstad Drabitzius <[email protected]>
Removed the key and corresponding functions for storing the update_state and the artifact type. It is now a part of the deployment data. Changelog: Title Ticket: MEN-7515 Signed-off-by: Daniel Skinstad Drabitzius <[email protected]>
b020054
to
771da43
Compare
Merging these commits will result in the following changelog entries: Changelogsmender-mcu (update-state)New changes in mender-mcu since main: Bug Fixes
|
Removed the key and corresponding functions for storing the update_state
and the artifact type. It is now a part of the deployment data.
Changelog: Title
Ticket: MEN-7515