Draft
Conversation
This rewrites most Foreman migrations to a new migration DSL. The DSL decouples from the actual answer file structure and is more expressive. Technically the DSL doesn't exist, but this at least makes sure that it's possible to express everything with the DSL I had in mind.
ekohl
commented
Jul 21, 2021
| @@ -1,74 +1,10 @@ | |||
| DELETED = { | |||
Member
Author
There was a problem hiding this comment.
I can be blamed for this. Kafo already removed unknown keys and this was never needed in the first place.
ekohl
commented
Jul 21, 2021
| mod_answers['dhcp_gateway'] = nil if mod_answers['dhcp_gateway'] == '192.168.100.1' | ||
| migrate_module('foreman_proxy') do |mod| | ||
| mod.unset_answer('repo') | ||
| mod.unset_answer('dhcp_gateway') if mod['dhcp_gateway'] == '192.168.100.1' |
Member
Author
There was a problem hiding this comment.
I thought about some more advanced DSL here:
mod.migrate_answer('dhcp_gateway') do |param|
param.unset_answer if param.value == '192.168.100.1'
endHowever, I didn't want to overload things too soon.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This rewrites most Foreman migrations to a new migration DSL. The DSL decouples from the actual answer file structure and is more expressive.
Technically the DSL doesn't exist, but this at least makes sure that it's possible to express everything with the DSL I had in mind. As a reference to theforeman/kafo#337.