-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
ibmcloud: add support for subdomains #1779
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ldez
requested changes
Dec 5, 2022
Formatting of comment. Co-authored-by: Ludovic Fernandez <[email protected]>
I was thinking that this would be the better error message because the value that will be used for %w is actually not the domain ID but a domain name. If you think this should not be changed it is fine with me. Co-authored-by: Ludovic Fernandez <[email protected]>
Use a more efficient way to determine the "parent" domain. Co-authored-by: Ludovic Fernandez <[email protected]>
Remove code no longer needed. Co-authored-by: Ludovic Fernandez <[email protected]>
"Error: providers/dns/ibmcloud/internal/wrapper.go:75:15: S1003: should use !strings.Contains(parent, ".") instead (gosimple) if !found || strings.Index(parent, ".") == -1 {"
ldez
approved these changes
Dec 6, 2022
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.
Thanks 👍
Thanks for quick review and working with me on this! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed that requesting wildcard certificates for subdomains does not work for the ibmcloud (softlayer) dns solver.
The problem is that the softlayer API getDomainID is used and the domain name is passed as an argument.
For wildcard certificates for subdomains this argument will be the subdomain. The subdomain is not a separate entity in softlayer DNS so no record and thus no domain ID is found.
This change will try to find the "parent" of the subdomain in case the domain that was used to find the domain ID has more than two parts.
When the parent can be found the correct acme challenge entries will be made and a wildcard certificate for a subdomain will be created successfully.
I did live tests with one of my domains in softlayer and with the change I am able to retrieve the wildcard cert for the subdomain(s). I tried:
*.toplevel.domain
*.1.toplevel.domain
*.1.2.toplevel.domain
toplevel.domain
2.toplevel.domain
2.3.toplevel.domain
I am a golang beginner so in case something is wrong with the code please tell me.
Thanks.