paerser icon indicating copy to clipboard operation
paerser copied to clipboard

CLI args and YAML/TOML parsers should be consistent

Open darkweaver87 opened this issue 5 months ago • 0 comments

Hi,

It's not a big issue but I think CLI args and YAML/TOML parsers should be consistent. We can't assign, for instance, the same entryPoint name using CLI, YAML or TOML. We should validate the character set for assets names.

We can run traefik this way:

./traefik '--entrypoints.>#$dezd|@àç_ç_".address=:18081' --entrypoints.traefik.address=:18080 --api.insecure

but we can't use this configuration file as it's not valid toml:

[entryPoints]
  [entryPoints.>#$dezd|@àç_ç_"]
    address = ":10080"

[api]
  insecure = true
2024/01/12 10:11:03 command ./traefik error: Near line 2 (last key parsed 'entryPoints'): expected '.' or ']' to end table name, but got '>' instead

or this yaml one:

entryPoints:
 >#$dezd|@àç_ç_": 
  address: ":10080"

api:
  insecure: true
2024/01/12 10:15:57 command traefik error: entryPoints cannot be a standalone element (type static.EntryPoints)

>#$dezd|@àç_ç_" shouldn't be valid as an entrypoint name.

Relates to https://github.com/traefik/traefik-helm-chart/pull/990#pullrequestreview-1817644449.

darkweaver87 avatar Jan 12 '24 09:01 darkweaver87