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

Move template migrations to schnauzer v2 #3633

Merged
merged 3 commits into from
Dec 6, 2023

Conversation

cbgbt
Copy link
Contributor

@cbgbt cbgbt commented Nov 30, 2023

Issue number:

Closes #3133

Description of changes:
The template migrator takes preventative steps to avoid overwriting user-provided settings or setting generators when they were initially generated by a setting generator. It does this by running the old generator and checking to see if the current value is a match (implying it has not been overwritten) before taking action.

The concept of "template metadata" disappears with schnauzer-v2, leaving behind a binary invocation which includes template information. This PR changes the schnauzer-v2 CLI to become a library that we can link against and invoke in migrations.

The previous schnauzer migration lives on (but deprecated) until such a time that we can archive all migrations that depend on it.

Testing done:

  • Provided unit tests pass
  • Migration testing new host containers passes forwards & backwards checks

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

This allows migrations to link against schnauzer rather than needing to
execute the binary.
This helps reduce the build time since the build system currently
compiles everything in the migrations' directory.
This replaces ReplaceTemplateMigration with SchnauzerTemplateMigration,
which uses the new template rendering machinery to perform the same
behavior as the previous migrations.
@cbgbt cbgbt marked this pull request as ready for review December 1, 2023 17:36
Copy link
Contributor

@etungsten etungsten left a comment

Choose a reason for hiding this comment

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

🚀

@cbgbt cbgbt merged commit 80a6551 into bottlerocket-os:develop Dec 6, 2023
46 checks passed
@cbgbt cbgbt deleted the schnauzer-v2-migrator branch December 6, 2023 19:50
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.

Re-implement Bottlerocket template system for Out-of-tree Builds
3 participants