-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hostRules: improve matchHost validation and parsing #29425
Comments
you mean |
Yes I did |
Can you confirm these are correct? gitlab.company.com:8080 -> https://gitlab.company.com:8080 |
Yes, correct |
We only create a migration PR for the repo config, so it should not be an issue if the config.js takes values from the env.
How should this be detected? Using |
Yes something like that |
We already error on this as the |
Describe the proposed change(s).
Goal: massage "incorrect" matchHost values with ports or paths, for example
gitlab.company.com:8080
orregistry.company.com/some/path
.Improve validation: if a matchHost value contains
"
or/
then we should addhttps://
as the prefix and check if it's a valid URL. If it's not then I think it's safe for us to raise a config validation error. If it's valid, then we don't need to migrate it, because some config.js configurations may not be possible to migrate (the value comes from env).Also improve validation of empty matchHost. If the
matchHost
key is defined, but the value isundefined
, then we should warn. This is commonly caused by empty process.env.SOMETHING being used. We should similar do for empty string""
.Finally, we should enhance the addRule function to do similar logic and prefix the matchHost with
https://
if it contains:
or/
.The text was updated successfully, but these errors were encountered: