Skip to content

Commit

Permalink
OCPBUGS-32776: Fix IBM Public Cloud DNS Provider Update Logic
Browse files Browse the repository at this point in the history
The IBM Public Cloud DNS provider (cis_provider.go) had a bug in
`createOrUpdateDNSRecord` where it checked for the existence of a
DNS record by filtering both DNS name and target. If the target
was updated (e.g., due to a load balancer recreation), the logic
would not match the existing DNS record. As a result, the function
would attempt to create a new record, but fail because a record with
that name already existed, as multiple DNS records with the same
name are not allowed.

The fix is to remove the filtering by target and rely solely on
filtering by name, as the name is the only attribute that needs
to be unique.
  • Loading branch information
gcs278 committed Aug 22, 2024
1 parent ea74d3b commit b387d07
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion pkg/dns/ibm/public/cis_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ func (p *Provider) createOrUpdateDNSRecord(record *iov1.DNSRecord, zone configv1
dnsName := strings.TrimSuffix(record.Spec.DNSName, ".")
listOpt.SetName(dnsName)
for _, target := range record.Spec.Targets {
listOpt.SetContent(target)
result, response, err := dnsService.ListAllDnsRecords(listOpt)
if err != nil {
if response != nil && response.StatusCode != http.StatusNotFound {
Expand Down

0 comments on commit b387d07

Please sign in to comment.