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

digitalocean: dns operations should be idempotent #4882

Merged

Conversation

andrewsykim
Copy link
Member

@andrewsykim andrewsykim commented Apr 3, 2018

Modifies the DNS code for DigitalOcean to conform to what is expected from kops - where applying a record set overwrites any previous records.

#2150

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 3, 2018
}

// digitalocean record.Name returns record without the zone prefix
// so normalize record by removing zone suffix
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "prefix" in the comment here should be "suffix" (?)


glog.V(2).Infof("record change set additions complete")
}

if len(r.removals) > 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be problematic, if we temporarily delete a DNS record that is important, and there's a delay before we recreate it.

Hopefully everything is using upserts instead of add / remove pairs, but the distinction hasn't mattered as much where we've had batch operations.

We inherited this API from the federation code, and I added upsert IIRC. We could also look at how external-dns is handling it - the long term goal is to get closer to that code :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I don't love this implementation and it seems error prone, but DNS API is not setup in a way that plays nicely with the interface from the federation code. I'll take a look at external-dns and let you know if something better comes up :)

@justinsb
Copy link
Member

justinsb commented Apr 3, 2018

/lgtm

(though tests are failing anyway, so it won't really help)

Two comments though...

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 3, 2018
@andrewsykim andrewsykim force-pushed the digitalocean-improve-dns branch from a11c861 to 65fb2bc Compare April 3, 2018 21:52
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 3, 2018
@andrewsykim andrewsykim force-pushed the digitalocean-improve-dns branch from 65fb2bc to 61dd131 Compare April 3, 2018 21:52
@justinsb
Copy link
Member

justinsb commented Apr 4, 2018

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewsykim, justinsb

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:
  • OWNERS [andrewsykim,justinsb]

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

@k8s-ci-robot k8s-ci-robot merged commit ecc28e1 into kubernetes:master Apr 4, 2018
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.

3 participants