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

05core: add coreos-ignition-delete-config.service for upgrade boots #1738

Merged
merged 1 commit into from
May 18, 2022
Merged

05core: add coreos-ignition-delete-config.service for upgrade boots #1738

merged 1 commit into from
May 18, 2022

Conversation

bgilbert
Copy link
Contributor

@bgilbert bgilbert commented May 13, 2022

Ignition 2.14.0 adds ignition-delete-config.service, which deletes Ignition configs from VMware and VirtualBox on first boot. Add coreos-ignition-delete-config.service to do the same thing on existing machines on upgrade, using a stamp file in /var/lib to avoid multiple runs.

Add a drop-in for ignition-delete-config.service that creates a stamp file in /run, and then chain from that stamp to the long-term stamp in /var/lib, ensuring that we don't delete configs twice on newly-provisioned machines. The upstream service can't create the stamp directly in /var/lib because it runs before /var is mounted.

Prevent coreos-ignition-delete-config.service from running if ignition-delete-config.service is masked, ensuring that the mask operation documented upstream prevents the config from ever being deleted, as intended.

We can remove this after the next barrier release in FCOS and barrier equivalent in RHCOS.

The plan is to do a coreos-status post documenting systemctl mask ignition-delete-config.service before shipping this.

jlebon
jlebon previously approved these changes May 13, 2022
Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!
Some optional nits; LGTM as is.

Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments/questions.

@bgilbert
Copy link
Contributor Author

Added requested comments.

Ignition 2.14.0 adds ignition-delete-config.service, which deletes
Ignition configs from VMware and VirtualBox on first boot.  Add
coreos-ignition-delete-config.service to do the same thing on existing
machines on upgrade, using a stamp file in /var/lib to avoid multiple
runs.

Add a drop-in for ignition-delete-config.service that creates a stamp
file in /run, and then chain from that stamp to the long-term stamp in
/var/lib, ensuring that we don't delete configs twice on newly-
provisioned machines.  The upstream service can't create the stamp
directly in /var/lib because it runs before /var is mounted.

Prevent coreos-ignition-delete-config.service from running if
ignition-delete-config.service is masked, ensuring that the mask operation
documented upstream prevents the config from ever being deleted, as
intended.

We can remove this after the next barrier release in FCOS and barrier
equivalent in RHCOS.
@bgilbert bgilbert marked this pull request as ready for review May 17, 2022 21:59
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bgilbert bgilbert merged commit 8e08f7b into coreos:testing-devel May 18, 2022
@bgilbert bgilbert deleted the rmcfg/testing-devel branch May 18, 2022 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants