cluster/services/dns: fix regex handling
This commit is contained in:
parent
2bdb62b255
commit
b60a1cd5a2
1 changed files with 1 additions and 1 deletions
|
@ -20,7 +20,7 @@ let
|
|||
rewriteRecords = lib.filterAttrs (_: record: record.rewrite.target != null) cluster.config.dns.records;
|
||||
|
||||
rewrites = lib.mapAttrsToList (_: record: let
|
||||
maybeEscapeRegex = str: if record.rewrite.type == "regex" then "^${lib.escapeRegex str}$" else str;
|
||||
maybeEscapeRegex = str: if record.rewrite.type == "regex" then "${lib.escapeRegex str}$" else str;
|
||||
in "rewrite stop name ${record.rewrite.type} ${record.name}${maybeEscapeRegex ".${record.root}."} ${record.rewrite.target}. answer auto") rewriteRecords;
|
||||
|
||||
rewriteConf = pkgs.writeText "coredns-rewrites.conf" (lib.concatStringsSep "\n" rewrites);
|
||||
|
|
Loading…
Reference in a new issue