USHIFT-1083 Back up data if previous boot was healthy#1826
USHIFT-1083 Back up data if previous boot was healthy#1826pmtk wants to merge 9 commits intoopenshift:mainfrom
Conversation
|
/assign @dhellmann @pacevedom |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pmtk The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
microshift admin ostree {get,set}-health + greenbootmicroshift admin ostree {get,set}-health + greenboot
335a15f to
68efd88
Compare
5f0a5df to
7e1520c
Compare
microshift admin ostree {get,set}-health + greenboot9bf64a9 to
146fc77
Compare
packaging/greenboot/green.sh
Outdated
There was a problem hiding this comment.
Are there other sub-commands to admin ostree besides set-health? If not, maybe we only need admin set-healthy and admin set-unhealthy.
There was a problem hiding this comment.
Initially there was supposed to be prerun subcommand, but I incorporated into run so I'll drop one level
There was a problem hiding this comment.
I made more changes: removed admin command, data and health are top level commands, health is hidden (not shown in help)
pkg/admin/history/file_storage.go
Outdated
There was a problem hiding this comment.
It would be safer to write a new file then move it over the top of the existing file.
pkg/admin/prerun/advisor_backup.go
Outdated
There was a problem hiding this comment.
Could this function just return false in this case, to make it safer to use?
There was a problem hiding this comment.
Maybe, not sure
Ideally these advisors would be more like "decision tree" structs to have everything "strongly typed", but it might not contribute to readability.
But for now I'd rather have this panic (at least until release) so it doesn't go unnoticed (i.e. this flow should be considered a fault in implementation), WDYT?
decb76c to
b889134
Compare
|
@dhellmann I moved RF test (with comments) to #1866 |
6775dcc to
db00a3b
Compare
db00a3b to
294da29
Compare
|
@pmtk: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
dhellmann
left a comment
There was a problem hiding this comment.
This PR is growing pretty big, and it's doing a lot of things that don't seem to be in scope for the description of the original ticket.
Could we store the health state as a simple string in a file by itself? That would let the greenboot integration just be shell scripts that write to the file, and then MicroShift could read that file to check the state on startup and decide whether to do the backup. Then we could bring some of the rest of the accounting stuff for history in via separate PRs linked to some of the other tickets, where the code changes would be smaller and easier to review.
|
|
||
| SCRIPT_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")" | ||
|
|
||
| if [[ "${SCRIPT_DIR}" == *"green.d"* ]]; then |
There was a problem hiding this comment.
This feels tricky. Could we just have 2 scripts so we're explicitly passing the health status?
|
I'll split this PR into smaller pieces starting with #1874 |
|
@pmtk: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
No description provided.