diff --git a/cli/domain/create.go b/cli/domain/create.go index 3ca2670ea..4b88bffb6 100644 --- a/cli/domain/create.go +++ b/cli/domain/create.go @@ -100,6 +100,19 @@ Which means you can then deploy an app against "myapp.foo.com" successfully. record.Priority = priority } + records, err := provider.GetRecords(c.Context, zone) + if err != nil { + logrus.Fatal(err) + } + + for _, existingRecord := range records { + if existingRecord.Type == record.Type && + existingRecord.Name == record.Name && + existingRecord.Value == record.Value { + logrus.Fatal("provider library reports that this record already exists?") + } + } + createdRecords, err := provider.SetRecords( c.Context, zone, @@ -128,9 +141,10 @@ Which means you can then deploy an app against "myapp.foo.com" successfully. strconv.Itoa(createdRecord.Priority), }) - table.SetCaption(true, "record created") table.Render() + logrus.Info("record created") + return nil }, }