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

Handle the migration to the new TXT format: missing records to be created separately #2913

Conversation

alebedev87
Copy link
Contributor

@alebedev87 alebedev87 commented Jul 26, 2022

Description
Follow-up of #2811. Aims at addressing the following error when the missing new format TXT record gets created and deleted in the same batch:

Applying provider record filter for domains: [external.dns. .external.dns.]"
time="2022-07-26T07:17:45Z" level=info msg="Desired change: UPSERT cname-externaldns-e2e.external.dns TXT [Id: /hostedzone/]"
time="2022-07-26T07:17:45Z" level=info msg="Desired change: UPSERT externaldns-e2e.external.dns A [Id: /hostedzone/]"
time="2022-07-26T07:17:45Z" level=info msg="Desired change: UPSERT externaldns-e2e.external.dns TXT [Id: /hostedzone/]"
time="2022-07-26T07:17:45Z" level=info msg="Desired change: CREATE cname-externaldns-e2e.external.dns TXT [Id: /hostedzone/]"
time="2022-07-26T07:17:46Z" level=error msg="Failure in zone external.dns. [Id: /hostedzone/]"
time="2022-07-26T07:17:46Z" level=error msg="InvalidChangeBatch: [The request contains an invalid set of changes for a resource record set 'TXT cname-externaldns-e2e.external.dns.']\n\tstatus code: 400, request id: "

This error may happen when the DNS record was created with the external-dns of version < 0.12.0 then the target of the source changed (ClusterIP, LoadBalancer's DNS record, HostIP) and then the new (> 0.12.0) version kicks the migration logic. The migration code sees that there is a new format TXT record is missing and adds it as "to be created" however the target changed and A/CNAME record needs to be changed too along with its TXT records.

Checklist

  • Unit tests updated
  • End user documentation updated

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 26, 2022
@alebedev87
Copy link
Contributor Author

/assign @Raffo

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 26, 2022
@Raffo
Copy link
Contributor

Raffo commented Jul 27, 2022

Thanks for this PR! I will build an image and test it. Can you add unit tests in the meantime?

@alebedev87 alebedev87 force-pushed the handle-missing-txt-record-fix-batch branch from 4ef06a2 to e2eb6c9 Compare July 27, 2022 10:54
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 27, 2022
@alebedev87
Copy link
Contributor Author

@Raffo : added a test which checks that a new plan is applied in case there are missing records.

@alebedev87 alebedev87 force-pushed the handle-missing-txt-record-fix-batch branch from e2eb6c9 to 0feb32d Compare July 27, 2022 10:57
@Raffo
Copy link
Contributor

Raffo commented Jul 27, 2022

I e2e tested this, LGTM

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 27, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alebedev87, Raffo

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

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants