Skip to content
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

[Azure DNS] Fixes trimming of zone inferred via zone discovery #1466

Merged
merged 2 commits into from
Mar 12, 2019

Conversation

logicfox
Copy link
Contributor

@logicfox logicfox commented Mar 11, 2019

Signed-off-by: Aditya Sundaramurthy aditya.sundaramurthy@gmail.com

What this PR does / why we need it: Fixes #1459 . Uses inferred zone name from the Azure DNS API over the configured hostedZoneName param in the ClusterIssuer

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #1459

Special notes for your reviewer: Overrides hostedZoneName config param.

Release note:

Removes need for `hostedZoneName` to be specified. Uses discovered DNS zone name instead.

…ostedZoneName'

Signed-off-by: Aditya Sundaramurthy <aditya.sundaramurthy@gmail.com>
@jetstack-bot jetstack-bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 11, 2019
@jetstack-bot jetstack-bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 11, 2019
@jetstack-bot
Copy link
Contributor

Hi @logicfox. Thanks for your PR.

I'm waiting for a jetstack or cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jetstack-bot jetstack-bot added area/acme Indicates a PR directly modifies the ACME Issuer code area/acme/dns01 Indicates a PR modifies ACME DNS01 provider code size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 11, 2019
@logicfox
Copy link
Contributor Author

/assign @DanielMorsing

@DanielMorsing
Copy link
Contributor

Not sure I understand what this is trying to fix. Could you explain a bit?

@logicfox
Copy link
Contributor Author

Fixes #1459 . When using Azure DNS, the TXT record used for the DNS01 challenge is set incorrectly when the ClusterIssuer CRD is not configured with the hostedZoneName parameter. The domain name is repeated twice in the TXT record, i.e. instead of _acme-challenge.mycompany.com, the record is created for _acme-challenge.mycompany.com.mycompany.com when the hostedZoneName parameter is not set in the ClusterIssuer CRD.

The issue can be traced to the existing code which trims the domain from the fqdn based on the zoneName field in the DNSProvider struct in the trimFqdn function. This field is not set if the hostedZoneName param is not set.

To mitigate this error, the domain name used in the trimFqdn function should be the zone name discovered through the getHostedZoneName function.

@munnerz
Copy link
Member

munnerz commented Mar 11, 2019

Thanks for the PR 😄

I think this needs modifying to still allow overriding the parameter using hostedZoneName, else it becomes a backwards incompatible change.

We may remove the hostedZoneName field in the future, but we needn't do it as part of this PR given we can check to see if it is set, and otherwise fall back to the detected zone 😄

@munnerz
Copy link
Member

munnerz commented Mar 11, 2019

/ok-to-test

@jetstack-bot jetstack-bot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 11, 2019
@logicfox
Copy link
Contributor Author

Makes sense. I'll fix that to default to the hostedZoneName if provided.

Signed-off-by: Aditya Sundaramurthy <aditya.sundaramurthy@gmail.com>
@jetstack-bot jetstack-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 11, 2019
@tommy-dk
Copy link

@logicfox: Nice work! Seems to fix the bug I reported. 👍

@munnerz
Copy link
Member

munnerz commented Mar 12, 2019

/lgtm
/approve
/milestone v0.7

@jetstack-bot jetstack-bot added this to the v0.7 milestone Mar 12, 2019
@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 12, 2019
@jetstack-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: logicfox, munnerz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jetstack-bot jetstack-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/acme/dns01 Indicates a PR modifies ACME DNS01 provider code area/acme Indicates a PR directly modifies the ACME Issuer code dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. ok-to-test release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Azure DNS] DNS record for "mydomain.com" not yet propagated
5 participants