Skip to content

Support escaping dots in label keys with \.#784

Merged
lucaslorentz merged 1 commit intomasterfrom
feat/escape-dots-in-labels
Mar 12, 2026
Merged

Support escaping dots in label keys with \.#784
lucaslorentz merged 1 commit intomasterfrom
feat/escape-dots-in-labels

Conversation

@lucaslorentz
Copy link
Owner

Summary

  • Adds support for \. as an escaped literal dot in Docker label keys
  • The . character is used as a nesting separator, which prevented using literal dots in directive names (e.g. domain names like mydomain.fr or Caddy's {blocks.name} syntax)
  • \. is replaced before regex parsing and restored as . in the directive name

Examples

Caddy blocks syntax (#767):

caddy.reverse_proxy.{blocks\.proxy_target} =

produces:

reverse_proxy {
    {blocks.proxy_target}
}

Domain names (#699):

caddy.dynamic_dns.domains.mydomain\.fr =

produces:

dynamic_dns {
    domains {
        mydomain.fr
    }
}

Fixes #767
Fixes #699

Test plan

  • All existing tests pass
  • New test case escaped_dots.txt covers both use cases

🤖 Generated with Claude Code

The dot character is used as a nesting separator in Docker label keys,
making it impossible to use literal dots in directive names (e.g.
domain names like mydomain.fr or Caddy's {blocks.name} syntax).

This adds support for \. as an escaped literal dot, so:
  caddy.dynamic_dns.domains.mydomain\.fr
produces:
  dynamic_dns { domains { mydomain.fr } }

Fixes #767
Fixes #699

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lucaslorentz lucaslorentz merged commit 90f45ae into master Mar 12, 2026
3 checks passed
@lucaslorentz lucaslorentz deleted the feat/escape-dots-in-labels branch March 12, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to escape periods from CDP parsing in labels Can't find how to escape . in directive

1 participant