-
Notifications
You must be signed in to change notification settings - Fork 392
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
daemon: Handle osImageURL bootstrap #362
daemon: Handle osImageURL bootstrap #362
Conversation
This is hoisted out of #324 |
if err != nil { | ||
if os.IsNotExist(err) { |
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.
Why check if nothing different is done?
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.
Good catch, fixed thanks!
/retest |
We need special handling for the *initial* case where we boot into a target config, but we may be using an old OS image. Currently the MCD would treat this as "config drift" and go degraded. Today we write the node annotations to a file in `/etc` as part of the rendered Ignition. Use that as a "bootstrap may be required" flag, and handle it specially - if we need to pivot, do *just* that and reboot. We also clean things up by unlinking that node annotation file; after that, if the `osImageURL` drifts from the expected config, we'll go degraded, just like if someone modified a file.
deb7201
to
8a7107e
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.
Looks sane to me! Will give others time to review.
/approve
// currentConfig's osImageURL should now be *truth*. | ||
// In other words if it drifts somehow, we go degraded. | ||
if err := os.Remove(InitialNodeAnnotationsFilePath); err != nil { | ||
return errors.Wrapf(err, "Removing initial node annotations file") |
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.
Oh neat, I like Wrapf
.
Logs from PR:
Though of course it's not doing anything yet. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, jlebon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Remove hello-openshift imagestream
We need special handling for the initial case where we boot
into a target config, but we may be using an old OS image. Currently
the MCD would treat this as "config drift" and go degraded.
Today we write the node annotations to a file in
/etc
as part of therendered Ignition. Use that as a "bootstrap may be required" flag,
and handle it specially - if we need to pivot, do just that and
reboot.
We also clean things up by unlinking that node annotation file; after
that, if the
osImageURL
drifts from the expected config, we'll godegraded, just like if someone modified a file.