The way we setup peerdns isn't correct. We don't want to require both
that the proto be "dhcp" and "dhcpv6". That doesn't even make
sense. And the fact that we can say that makes even less sense.
In order to show the failure, we add a failing test. We then implement a
fix by adding a validator that disjoins multiple other validators. The
test is effectively what we want in reality, so it passing here should
give good confidence that we can do what we want.
The way we setup
peerdns
isn't correct. We don't want to require both that theproto
be"dhcp"
and"dhcpv6"
. That doesn't even make sense. And the fact that we can say that makes even less sense.In order to show the failure, we add a failing test. We then implement a fix by adding a validator that disjoins multiple other validators. The test is effectively what we want in reality, so it passing here should give good confidence that we can do what we want.
It's unfortunate that we have to write this validator. Hopefully, it's an oversight and not intentional. We don't want to maintain this indefinitely. See https://github.com/hashicorp/terraform-plugin-framework-validators/issues/122 for the upstream issue.