You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add configurable DNS comment template for CNAME records (#275)
* feat: add configurable DNS comment template for CNAME records
Restore DNS CNAME record comments that were removed when ownership
tracking migrated from comment-based to TXT-based.
Add --dns-comment-template flag and corresponding Helm value that
accepts a Go template with {{.TunnelName}}, {{.TunnelId}}, and
{{.Hostname}} variables. Default template preserves the original
comment format. Set to empty string to disable.
Logs a warning when rendered comment exceeds 100 characters
(Cloudflare Free plan limit; Pro/Biz/Ent allow 500).
Closes#274
* fix: quote helm template arg, remove dead field, clean up warning log
- Quote --dns-comment-template in deployment.yaml to prevent space-splitting
- Add blank line between clusterDomain and dnsCommentTemplate comments in values.yaml
- Remove unused dnsCommentTemplateS field from TunnelClient
- Simplify length warning log message (remove "WARNING:" prefix)
* test: add unit tests for renderDNSComment
Table-driven tests covering: disabled template, default template,
all template variables, long comments exceeding 100 chars, invalid
template syntax graceful degradation, and static templates.
logger.Error(err, "bootstrap tunnel client with tunnel name")
76
78
os.Exit(1)
@@ -145,6 +147,7 @@ func main() {
145
147
rootCommand.PersistentFlags().StringSliceVar(&options.cloudflaredExtraArgs, "cloudflared-extra-args", options.cloudflaredExtraArgs, "extra arguments to pass to cloudflared")
146
148
rootCommand.PersistentFlags().StringVar(&options.clusterDomain, "cluster-domain", options.clusterDomain, "kubernetes cluster domain, used to build service FQDN (should match kubelet --cluster-domain)")
147
149
rootCommand.PersistentFlags().BoolVar(&options.leaderElect, "leader-elect", options.leaderElect, "enable leader election for high availability")
150
+
rootCommand.PersistentFlags().StringVar(&options.dnsCommentTemplate, "dns-comment-template", options.dnsCommentTemplate, "Go template for DNS record comments. Available variables: {{.TunnelName}}, {{.TunnelId}}, {{.Hostname}}. Set to empty string to disable. Note: Cloudflare limits comment length by plan (Free: 100, Pro/Biz/Ent: 500 chars). See https://developers.cloudflare.com/dns/manage-dns-records/reference/record-attributes/")
0 commit comments