awlsring / terraform-provider-headscale

A terraform provider for Headscale
https://registry.terraform.io/providers/awlsring/headscale/latest
Apache License 2.0
22 stars 2 forks source link

too strict tags validator #6

Closed paragor closed 6 months ago

paragor commented 6 months ago

in headscale_device_tags (Resource) there is too strict regexp for tag

stringvalidator.RegexMatches(regexp.MustCompile("^tag:[\\w\\d]+$"), "tag must follow scheme of `tag:<value>`"),

it is not allowed use tag "tag:location:sgp1", because it have :, that not \w and not \d

headscale allow to use that tags

awlsring commented 6 months ago

Yeah after some playing around, it seems like a tag can be of almost any length and any unicode character so this regex should be ^tag:.*.

I'll cut a fix for this sometime soon.