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

AWS Route53 dnsprovider #26049

Merged
merged 2 commits into from Jun 4, 2016
Merged

AWS Route53 dnsprovider #26049

merged 2 commits into from Jun 4, 2016

Conversation

ghost
Copy link

@ghost ghost commented May 23, 2016

Still needs unit tests, and some other cleanup. Review not urgent, but feel free to make a first pass.
Only need to look at the last two commits. The prior commits will go in as #26020. This will need to be rebased against #26020 once that merges.

It's a bare minimum implementation, only what's required for Ubernetes Federated Services (managing basic A and CNAME records). More functionality (health checks, geolocation etc) can be fairly easily added as required.

It also requires github.com/aws/aws-sdk-go/service/route53 to be vendored into godeps, which I haven't managed to do successfully yet (Oh Godep!)

cc: @justinsb FYI

@ghost ghost added this to the v1.3 milestone May 23, 2016
@ghost ghost assigned madhusudancs May 23, 2016
@k8s-github-robot k8s-github-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. release-note-label-needed labels May 23, 2016
@ghost
Copy link
Author

ghost commented May 23, 2016

@nikhiljindal FYI, as you're doing such a marvellous job of shepherding the cluster federation PR's through the pipeline.

@ghost
Copy link
Author

ghost commented May 23, 2016

@mfanjie FYI

@ghost
Copy link
Author

ghost commented May 24, 2016

!!! 'gofmt -s' needs to be run on the following files: 
./federation/pkg/dnsprovider/providers/aws/route53/route53_test.go
./federation/pkg/dnsprovider/providers/aws/route53/zone.go
./federation/pkg/dnsprovider/providers/aws/route53/interface.go
./federation/pkg/dnsprovider/providers/aws/route53/rrset.go
./federation/pkg/dnsprovider/providers/aws/route53/internal/stubs/doc.go
./federation/pkg/dnsprovider/providers/aws/route53/rrsets.go
./federation/pkg/dnsprovider/providers/aws/route53/route53.go
FAILED   ./hack/../hack/verify-gofmt.sh 8s

@ghost ghost changed the title WIP: AWS Route53 dnsprovider AWS Route53 dnsprovider May 29, 2016
@ghost ghost added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels May 29, 2016
@k8s-github-robot k8s-github-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 29, 2016
@ghost ghost added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Jun 1, 2016
@ghost
Copy link
Author

ghost commented Jun 1, 2016

@madhusudancs I added unit tests, which all pass. Ready for review. I'll clean up the last few todo's tomorrow, and check hack/verify-all.sh, but please go ahead and do a first pass before that if you can.

@ghost
Copy link
Author

ghost commented Jun 1, 2016

cc: @mfanjie @nikhiljindal FYI.

@k8s-github-robot k8s-github-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 1, 2016
@ghost
Copy link
Author

ghost commented Jun 1, 2016

Similar gofmt error to one I saw in one of my other PR's #25991. I must have an incompatible version of gfmt on my local machine or something. Pity that gofmt refuses to tell us what version it is :-)

./federation/pkg/dnsprovider/providers/aws/route53/rrsets.go
FAILED   ./hack/../hack/verify-gofmt.sh 17s
 which gofmt
/usr/local/go/bin/gofmt
$ which go
/usr/local/go/bin/go
$ go version
go version go1.6 darwin/amd64
$ gofmt --version
flag provided but not defined: -version
usage: gofmt [flags] [path ...]
  -cpuprofile string
        write cpu profile to this file
  -d    display diffs instead of rewriting files
  -e    report all errors (not just the first 10 on different lines)
  -l    list files whose formatting differs from gofmt's
  -r string
        rewrite rule (e.g., 'a[b:len(a)] -> a[b:]')
  -s    simplify code
  -w    write result to (source) file instead of stdout

@ghost ghost assigned nikhiljindal and unassigned madhusudancs Jun 1, 2016
@ghost
Copy link
Author

ghost commented Jun 1, 2016

Reassigning to @nikhiljindal for review, as discussed with @madhusudancs

)

// Compile time check for interface adeherence
var _ Interface = Interface{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I seem to be missing something here. We are checking that it implements itself?

Copy link
Author

Choose a reason for hiding this comment

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

Good catch - the left hand one is supposed to be dnsprovider.Interface. Will fix.

Copy link
Author

Choose a reason for hiding this comment

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

Done.

},
HostedZoneId: aws.String(*rrset.(ResourceRecordSet).rrsets.zone.impl.Id), // Required
}
_, err := rrsets.zone.zones.interface_.service.ChangeResourceRecordSets(input)
Copy link
Contributor

Choose a reason for hiding this comment

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

Its surprising that we have to construct the whole set to remove as well.
Suprised that there is no Add and Remove methods, only Change.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, that's how most of the DNS interfaces seem to work. To delete, you have to pass a fully matching record set, not just an ID. Otherwise it fails, by design. The method is called Change...(), but Action:"DELETE" makes it equivalent to a Delete() method.

@ghost
Copy link
Author

ghost commented Jun 1, 2016

@nikhiljindal All review comments addressed. PTAL.

@ghost
Copy link
Author

ghost commented Jun 1, 2016

Removed unused stubs package, which should resolve the gofmt verification error.

// Compile time check for interface adeherence
var _ dnsprovider.Interface = Interface{}

type Interface struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a test only interface? Move it to testing package?

Copy link
Author

Choose a reason for hiding this comment

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

No, it's the interface to Route53. I think we should leave it where it is.

@nikhiljindal
Copy link
Contributor

Thanks for the fixes @quinton-hoole
Mostly looks good, added a few comments.

Feel free to self apply the label after fixing.

@ghost
Copy link
Author

ghost commented Jun 2, 2016

Oh dear. Lingering godep issues. I'll sort this out in the morning.

federation/pkg/dnsprovider/providers/aws/route53/route53.go:26:2: cannot find package "github.com/aws/aws-sdk-go/service/route53" in any of:
    /go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/aws/aws-sdk-go/service/route53 (vendor tree)
    /usr/local/go/src/github.com/aws/aws-sdk-go/service/route53 (from $GOROOT)
    /go/src/k8s.io/kubernetes/_output/local/go/src/github.com/aws/aws-sdk-go/service/route53 (from $GOPATH)

@k8s-github-robot k8s-github-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 2, 2016
@ghost
Copy link
Author

ghost commented Jun 2, 2016

OK, addressed final review comments, and added missing godeps. Applying LGTM.

@ghost ghost added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 2, 2016
@k8s-github-robot k8s-github-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 2, 2016
@ghost ghost added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jun 2, 2016
@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 3, 2016
@ghost ghost added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jun 3, 2016
@ghost
Copy link
Author

ghost commented Jun 3, 2016

Fixed minor typo that snuck in somehow and broke compilation.

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 3, 2016
@k8s-bot
Copy link

k8s-bot commented Jun 3, 2016

GCE e2e build/test passed for commit 5b42184.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Jun 4, 2016

GCE e2e build/test passed for commit 5b42184.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 6420496 into kubernetes:master Jun 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants