EXOSCALE: finish implementation of zone creation

This commit is contained in:
Jakob Ackermann 2025-01-08 20:58:11 +01:00
parent 2461f3dc50
commit ce8453042e
No known key found for this signature in database
GPG key ID: 17FA08AA7E62A231

View file

@ -83,7 +83,10 @@ func init() {
// EnsureZoneExists creates a zone if it does not exist
func (c *exoscaleProvider) EnsureZoneExists(domain string) error {
_, err := c.findDomainByName(domain)
if err == ErrDomainNotFound {
d := &egoscale.DNSDomain{UnicodeName: &domain}
_, err = c.client.CreateDNSDomain(context.Background(), c.apiZone, d)
}
return err
}