Skip to content

Commit

Permalink
Fix zone mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
linzeyan committed Dec 6, 2021
1 parent 315bec1 commit eb1e41f
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions registrar_amazon.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ func (a *AwsZoneView) InsertDataQuery() (string, []interface{}) {
}

func (a *AwsZoneView) GetZones(keyId, key string) ([]string, []AwsZoneView) {
var zone AwsZone
var temp, zone AwsZone
var id []string
req := AwsRequest(keyId, key)
param := &route53.ListHostedZonesInput{
MaxItems: aws.String("1000"),
MaxItems: aws.String("100"),
}
for zone.IsTruncated || zone.NextMarker == "" {
if zone.IsTruncated {
for temp.IsTruncated || temp.NextMarker == "" {
if temp.IsTruncated {
param = &route53.ListHostedZonesInput{
Marker: aws.String(zone.NextMarker),
Marker: aws.String(temp.NextMarker),
}
}
resp, err := req.ListHostedZones(param)
Expand All @@ -92,14 +92,15 @@ func (a *AwsZoneView) GetZones(keyId, key string) ([]string, []AwsZoneView) {
log.Println(err)
return nil, nil
}
err = json.Unmarshal(content, &zone)
err = json.Unmarshal(content, &temp)
if err != nil {
log.Println(err)
return nil, nil
}
for i := range zone.HostedZones {
id = append(id, zone.HostedZones[i].Id)
for i := range temp.HostedZones {
id = append(id, temp.HostedZones[i].Id)
}
zone.HostedZones = append(zone.HostedZones, temp.HostedZones...)
}
return id, zone.HostedZones
}
Expand Down

0 comments on commit eb1e41f

Please sign in to comment.