Refactor host remove override check, add CNAME+MX confirmation#444
Open
pederhan wants to merge 3 commits into
Open
Refactor host remove override check, add CNAME+MX confirmation#444pederhan wants to merge 3 commits into
host remove override check, add CNAME+MX confirmation#444pederhan wants to merge 3 commits into
Conversation
terjekv
approved these changes
Apr 25, 2026
Collaborator
terjekv
left a comment
There was a problem hiding this comment.
I do feel like we're patching over a larger underlying problem around both force and how hosts are tied to RRs. This is a solid improvement considering the existing design, but we should ideally be able to generalise RR management.
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 PR removes some code duplication and makes the override checking + warning message construction more consistent in
host remove.Furthermore, it now ensures associated MX and CNAME records are also printed when they are deleted.
Future work
This PR does not touch the A/AAAA record override checking, nor does it make any modifications to
forced(). We rely on different, more complicated logic for IP address checking that cannot be defined as neatly and declaratively as the other record types.A potential improvement would be to move the entire override checking logic into a separate class. That way, one can more easily share state between checks (active overrides, force enabled, etc.) while being able to include IP address checks into the same declarative framework that this PR adds.
Something like this (rough sketch):
To use:
One could even imagine we construct the entire message via the
check()method (or return some data structure):Thus we can move all this complicated checking and message construction logic out of
host removeand make it testable via unit tests.