-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Allow Træfik to know if a Host rule is malformed #3848
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
Allow Træfik to know if a Host rule is malformed #3848
Conversation
dtomcej
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
![]()
rules/rules.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rewrite this section like that:
var cleanDomains []string
for _, domain := range domains {
canonicalDomain := types.CanonicalDomain(domain)
if len(canonicalDomain) > 0 {
cleanDomains = append(cleanDomains, canonicalDomain)
}
}
return isHostRule, cleanDomains, nil
mmatur
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ldez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
80a436d to
6ec6251
Compare
What does this PR do?
This PR allows users to know if a
Hostrule is malformed by returning aboolto prevent that aHostRule has been detected.Thus if a
Hostrule is detected and no domain are returned, a specific error message can be created.Motivation
User reported that ACME has not created domains with the error message
Error getting valid domain: unable to generate a certificate when no domain is given..The error has came from his
Hostrule but the message has not indicated it.The PR improves the error management.
More