Skip to content

Commit

Permalink
Merge pull request #268 from gardener/fix-openstack-update
Browse files Browse the repository at this point in the history
[openstack-designate] Select correct recordset on updating wildcard domain names
  • Loading branch information
MartinWeindel authored Jul 12, 2022
2 parents d4c9301 + 1588749 commit 1b7d45f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/controller/provider/openstack/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,16 @@ func (exec *Execution) create(rset *recordsets.RecordSet) error {
}

func (exec *Execution) lookupRecordSetID(rset *recordsets.RecordSet) (string, error) {
name := dns.AlignHostname(rset.Name)
recordSetID := ""
handler := func(recordSet *recordsets.RecordSet) error {
recordSetID = recordSet.ID
if recordSet.Name == name {
recordSetID = recordSet.ID
}
return nil
}
exec.handler.config.RateLimiter.Accept()
err := exec.handler.client.ForEachRecordSetFilterByTypeAndName(exec.zone.Id().ID, rset.Type, dns.AlignHostname(rset.Name), handler)
err := exec.handler.client.ForEachRecordSetFilterByTypeAndName(exec.zone.Id().ID, rset.Type, name, handler)
if err != nil {
return "", fmt.Errorf("RecordSet lookup for %s %s failed with: %s", rset.Type, rset.Name, err)
}
Expand Down

0 comments on commit 1b7d45f

Please sign in to comment.