sassoftware / sas-container-recipes

A collection of recipes and other resources for building containers that include SAS Viya software.
https://www.sas.com
Apache License 2.0
89 stars 42 forks source link

regexNoSpecialCharacters in order.go does not like a hyphen "-" altough doc says is allowed #36

Open wweghe opened 5 years ago

wweghe commented 5 years ago

When running the sas-container-recipes, I get this message : The --docker-namespace argument contains invalid characters. It must contain contain only A-Z, a-z, 0-9, _, ., or - And my namespace is : sas-sbxwvw. So either the regexNoSpecialCharacters function in order.go is not correct, or the message should be changed to not allow a "-" (hyphen)

I'm not an regexp specialist but according to https://regex101.com/ this function : ^[_A-z0-9]([_A-z0-9\-\.])$ does not allow sas-sbxwvw, whereas this function : ^[_A-z0-9]([_A-z0-9-.])$ seems to allow sas-sbxwvw

wweghe commented 5 years ago

ok, cut&paste obviously made things worse... This is the code in the actual container recipes and not working for me : ^[_A-z0-9]*([_A-z0-9\\-\\.]*)$

This is working fine : ^[_A-z0-9]*([_A-z0-9\-\.]*)$

wweghe commented 5 years ago

Hmmm, but running the recipes with this regexp : ^[_A-z0-9]*([_A-z0-9\-\.]*)$ seems to result in an error : ./order.go:457:71: unknown escape sequence so obviously it's a bit more complicated....