Closed plasorak closed 1 year ago
Hi @plasorak
Sorry, I just noticed this issue! Probably you found a fix already but I'll try to answer anyways.
I think this is a case of schema actually doing its job but perhaps not doing the job that you actually want. The original developer of the dunedaq.appfwk.app.ModSpec
chose this string to be governed by this regex and so governed it is. The question then goes to that schema: should -
be allowed and should _
be excluded.
I note that this regex is the same defined by moo.re.ident
in moo's Jsonnet. An ident
is intended to be a limited string schema which in particular matches legal Python/C++ variable names. So, it must exclude -
and include _
.
If the particular string must match a different pattern then a different regex should be used in the string schema used in the larger ModSpec
.
To help that, moo provides other predefined regex. For example there is moo.re.dnshost
regex which can be used to define a string schema which is intended to match only legal DNS host names. That includes -
and excludes _
.
You can browse the built-in regex's here:
https://github.com/brettviren/moo/blob/master/moo/jsonnet-code/schema/re.jsonnet
If any are close but not perfect it would be reasonable to copy-paste them into some main DAQ schema file and edit as desired.
Oh, I see, so this is probably an appfwk
problem, rather than moo
, we just need to specify the correct string schema in ModSpec
. Thanks
The following code in the configuration generator for DUNE-DAQ:
Leads to the following when the name instance name is
flx-card-localhost-0
:Why can't a string have hyphens? Also the
_
shouldn't be in the regex pattern, because these apps name can be domain name with K8s.Is there a way to change the regex that it's trying to match?