Skip to content

Commit

Permalink
wip: debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Dec 12, 2024
1 parent 94b7421 commit 5e6d346
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions providers/dns/manageengine/manageengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,25 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
}},
}

_, err = d.client.CreateZoneRecord(ctx, zoneID, record)
zrs, err := d.client.CreateZoneRecord(ctx, zoneID, record)
if err != nil {
return fmt.Errorf("manageengine: create zone record: %w", err)
}

// TODO(ldez) to remove after debug.
for _, zr := range zrs {
if zr.DomainName == info.EffectiveFQDN {
fmt.Println("CreateZoneRecord zr.ZoneID", zr.ZoneID)

for _, r := range zr.Records {
fmt.Println("CreateZoneRecord record.Value", r.Value, info.Value)
if slices.Contains(r.Value, info.Value) {
fmt.Println("CreateZoneRecord r.ID", r.ID)
}
}
}
}

return nil
}

Expand Down Expand Up @@ -175,7 +189,6 @@ func (d *DNSProvider) findRecordID(ctx context.Context, zoneID int, info dns01.C

for _, zoneRecord := range zoneRecords {
if !strings.EqualFold(zoneRecord.DomainName, info.EffectiveFQDN) {
fmt.Println("findRecordID DomainName", zoneRecord.DomainName, info.EffectiveFQDN) // TODO(ldez) to remove after debug.
continue
}

Expand Down

0 comments on commit 5e6d346

Please sign in to comment.