Skip to content

Commit

Permalink
Merge pull request #2 from sfiera/main
Browse files Browse the repository at this point in the history
Update google.golang.org/api dependency
  • Loading branch information
brockwood authored May 24, 2022
2 parents e06d4ec + 9bc8f21 commit 9b5d2ae
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 11 deletions.
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ func (p *Provider) setCloudDNSRecord(ctx context.Context, zone string, values []
for _, record := range values {
rrs.Rrdatas = append(rrs.Rrdatas, record.Value)
}
googleRecord, err := p.service.Projects.ManagedZones.Rrsets.Create(p.Project, gcdZone, &rrs).Context(ctx).Do()
googleRecord, err := p.service.ResourceRecordSets.Create(p.Project, gcdZone, &rrs).Context(ctx).Do()
if err != nil {
if gErr, ok := err.(*googleapi.Error); !ok || (gErr.Code == 409 && !patch) {
return nil, err
}
// Record exists and we'd really like to get this libdns.Record into the zone so how about we try patching it instead...
googleRecord, err = p.service.Projects.ManagedZones.Rrsets.Patch(p.Project, gcdZone, rrs.Name, rrs.Type, &rrs).Context(ctx).Do()
googleRecord, err = p.service.ResourceRecordSets.Patch(p.Project, gcdZone, rrs.Name, rrs.Type, &rrs).Context(ctx).Do()
if err != nil {
return nil, err
}
Expand All @@ -110,7 +110,7 @@ func (p *Provider) deleteCloudDNSRecord(ctx context.Context, zone, name, dnsType
return err
}
fullName := libdns.AbsoluteName(name, zone)
_, err = p.service.Projects.ManagedZones.Rrsets.Delete(p.Project, gcdZone, fullName, dnsType).Context(ctx).Do()
_, err = p.service.ResourceRecordSets.Delete(p.Project, gcdZone, fullName, dnsType).Context(ctx).Do()
return err
}

Expand Down
11 changes: 3 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ module github.com/libdns/googleclouddns
go 1.15

require (
cloud.google.com/go v0.82.0
cloud.google.com/go v0.101.1
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/martian/v3 v3.2.1 // indirect
github.com/libdns/libdns v0.2.0
golang.org/x/net v0.0.0-20210525063256-abc453219eb5 // indirect
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c
golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea // indirect
google.golang.org/api v0.47.0
google.golang.org/genproto v0.0.0-20210524171403-669157292da3 // indirect
google.golang.org/grpc v1.38.0 // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5
google.golang.org/api v0.80.0
)
Loading

0 comments on commit 9b5d2ae

Please sign in to comment.