Skip to content

Commit

Permalink
LUADNS: populate zone cache after creating zone
Browse files Browse the repository at this point in the history
  • Loading branch information
das7pad committed Jan 8, 2025
1 parent 2461f3d commit af976e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion providers/luadns/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,15 @@ func (l *luadnsProvider) createDomain(domain string) error {
params := jsonRequestParams{
"name": domain,
}
if _, err := l.get("/zones", "POST", params); err != nil {
body, err := l.get("/zones", "POST", params)
if err != nil {
return fmt.Errorf("failed create domain (LuaDNS): %s", err)
}
z := zoneRecord{}
if err = json.Unmarshal(body, &z); err != nil {
return fmt.Errorf("error parsing zone response (LuaDNS): %s", err)
}
l.domainIndex[domain] = z.ID
return nil
}

Expand Down

0 comments on commit af976e4

Please sign in to comment.