[BUG] Missing zone file isn't reported by knotc
When defining a zone with a zone file, that doesn't exist, knotc will return 1, but not outputting any error message. This is really bad when checking a lot of zone files, since you don't know, which zone is broken or why.
I am using the "latest" docker image (v3.2.4) and created a small test setup:
root@1dd4637a2d1f:/test# ls
example.com.zone zones.conf
root@1dd4637a2d1f:/test# cat zones.conf
template:
- id: default
storage: ""
zone:
- domain: example.com
file: example.com.zone
- domain: example2.com
file: example2.com.zone
root@1dd4637a2d1f:/test# cat example.com.zone
@ IN SOA ns1.example.com. admin.example.com. (
1 ; serial number
3600 ; refresh
1800 ; retry
1209600 ; expire
3600 ; minimum
)
@ IN NS ns1.example.com.
ns1 IN A 127.0.0.1
When checking example.com it's all fine. When checking example2.com it returns 1, but no error is shown.
root@1dd4637a2d1f:/test# knotc -c zones.conf zone-check example.com
root@1dd4637a2d1f:/test# echo $?
0
root@1dd4637a2d1f:/test# knotc -c zones.conf zone-check example2.com
root@1dd4637a2d1f:/test# echo $?
1
root@1dd4637a2d1f:/test# knotc -c zones.conf zone-check
root@1dd4637a2d1f:/test# echo $?
1
When checking the non-existent example3.com, it will work as I expected:
root@1dd4637a2d1f:/test# knotc -c zones.conf zone-check example3.com
error: [example3.com.] no such zone found
root@1dd4637a2d1f:/test# echo $?
1