Skip to content

Commit

Permalink
004_mythic_beasts_dns: relax host constraint
Browse files Browse the repository at this point in the history
The Mythic Beasts DNS guide is broken by when used with CUE v0.9.x or
later. This updates the guide by removing a MinFields contraint,
allowing it to work with current CUE versions. We can re-add the
constraint when cue-lang/cue#3474 is resolved.

Fixes cue-labs#36

Signed-off-by: Jonathan Matthews <github@hello.jonathanmatthews.com>
  • Loading branch information
jpluscplusm committed Oct 1, 2024
1 parent bb252a9 commit 9ebbe33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions 004_mythic_beasts_dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ zones?: {
// These policies apply only to our primary domain
"my-primary-domain.test": {
// "blog.my-primary-domain.test", must exist (as it makes all our revenue)
// "blog.my-primary-domain.test", must exist (as it drives all our revenue!)
blog!: _
}
}
Expand Down Expand Up @@ -211,7 +211,6 @@ zones: [_]: #Zone
#Zone: {
[#Host]: {
struct.MinFields(1)
A?: #A
AAAA?: #AAAA
ANAME?: #ANAME
Expand All @@ -230,7 +229,7 @@ zones: [_]: #Zone
#AAAA: [#IPv6]: #Record
#ANAME: [#FQDN]: #Record
#CNAME: [#FQDN]: #Record
#MX: [#FQDN]: #Record & {
#MX: [#FQDN]: #Record & {
pri: int
}
#NS: [#FQDN]: #Record
Expand Down Expand Up @@ -324,7 +323,7 @@ _mythic_beast_zone_records: {
for zone_name, zone_config in zones {
(zone_name): [
for host_name, host_config in zone_config
for rrtype in [ "A", "AAAA", "ANAME", "CNAME", "NS", "TXT"]
for rrtype in ["A", "AAAA", "ANAME", "CNAME", "NS", "TXT"]
for _data, _record in (*host_config[rrtype] | {}) {
{host: host_name, ttl: _record.ttl, type: rrtype, data: _data}
},
Expand Down
3 changes: 1 addition & 2 deletions 004_mythic_beasts_dns/schema.cue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ zones: [_]: #Zone

#Zone: {
[#Host]: {
struct.MinFields(1)
A?: #A
AAAA?: #AAAA
ANAME?: #ANAME
Expand All @@ -28,7 +27,7 @@ zones: [_]: #Zone
#AAAA: [#IPv6]: #Record
#ANAME: [#FQDN]: #Record
#CNAME: [#FQDN]: #Record
#MX: [#FQDN]: #Record & {
#MX: [#FQDN]: #Record & {
pri: int
}
#NS: [#FQDN]: #Record
Expand Down

0 comments on commit 9ebbe33

Please sign in to comment.