Skip to content
This repository has been archived by the owner on Dec 18, 2020. It is now read-only.

Commit

Permalink
Address comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miao Luo committed Mar 23, 2017
1 parent 81cbac6 commit 734650f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dns-controller/cmd/dns-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func main() {
fmt.Printf("dns-controller version %s\n", BuildVersion)

dnsProviderId := "aws-route53"
flags.StringVar(&dnsProviderId, "dns", dnsProviderId, "DNS provider we should use (aws-route53, google-clouddns)")
flags.StringVar(&dnsProviderId, "dns", dnsProviderId, "DNS provider we should use (aws-route53, google-clouddns, coredns)")

var zones []string
flags.StringSliceVarP(&zones, "zone", "z", []string{}, "Configure permitted zones and their mappings")
Expand Down
7 changes: 4 additions & 3 deletions dns-controller/pkg/dns/dnscontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ func (o *dnsOp) deleteRecords(k recordKey, dnsProviderId string) error {
return fmt.Errorf("no suitable zone found for %q", fqdn)
}

// TODO: work-around before ResourceRecordSets.List() is implemented for CoreDNS
if dnsProviderId == k8scoredns.ProviderName {
// TODO: work-around before ResourceRecordSets.List() is implemented for CoreDNS
rrsProvider, ok := zone.ResourceRecordSets()
if !ok {
return fmt.Errorf("zone does not support resource records %q", zone.Name())
Expand All @@ -452,6 +452,7 @@ func (o *dnsOp) deleteRecords(k recordKey, dnsProviderId string) error {
return nil
}

// when DNS provider is aws-route53 or google-clouddns
rrs, err := o.listRecords(zone)
if err != nil {
return fmt.Errorf("error querying resource records for zone %q: %v", zone.Name(), err)
Expand Down Expand Up @@ -495,8 +496,8 @@ func (o *dnsOp) updateRecords(k recordKey, newRecords []string, ttl int64, dnsPr
}

var existing dnsprovider.ResourceRecordSet
// TODO: work-around before ResourceRecordSets.List() is implemented for CoreDNS
if dnsProviderId == k8scoredns.ProviderName {
// TODO: work-around before ResourceRecordSets.List() is implemented for CoreDNS
dnsRecord, err := rrsProvider.Get(fqdn)
if err != nil {
return fmt.Errorf("Failed to get DNS record %s with error: %v", fqdn, err)
Expand All @@ -506,7 +507,7 @@ func (o *dnsOp) updateRecords(k recordKey, newRecords []string, ttl int64, dnsPr
existing = dnsRecord
}
} else {

// when DNS provider is aws-route53 or google-clouddns
rrs, err := o.listRecords(zone)
if err != nil {
return fmt.Errorf("error querying resource records for zone %q: %v", zone.Name(), err)
Expand Down
1 change: 0 additions & 1 deletion upup/pkg/fi/cloudup/apply_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ func (c *ApplyClusterCmd) Run() error {
)
case fi.CloudProviderVSphere:
l.Builders = append(l.Builders,
&model.DNSModelBuilder{KopsModelContext: modelContext},
&model.PKIModelBuilder{KopsModelContext: modelContext})

default:
Expand Down

0 comments on commit 734650f

Please sign in to comment.