diff --git a/commands/getZones.go b/commands/getZones.go index 3ac9c6f21..469ccb635 100644 --- a/commands/getZones.go +++ b/commands/getZones.go @@ -351,11 +351,7 @@ func formatDsl(zonename string, rec *models.RecordConfig, defaultTTL uint32) str case "TLSA": target = fmt.Sprintf(`%d, %d, %d, "%s"`, rec.TlsaUsage, rec.TlsaSelector, rec.TlsaMatchingType, rec.GetTargetField()) case "TXT": - if len(rec.TxtStrings) == 1 { - target = `"` + rec.TxtStrings[0] + `"` - } else { - target = `["` + strings.Join(rec.TxtStrings, `", "`) + `"]` - } + target = jsonQuoted(rec.GetTargetField()) // TODO(tlim): If this is an SPF record, generate a SPF_BUILDER(). case "NS": // NS records at the apex should be NAMESERVER() records. diff --git a/integrationTest/integration_test.go b/integrationTest/integration_test.go index 69bed066d..42196b82f 100644 --- a/integrationTest/integration_test.go +++ b/integrationTest/integration_test.go @@ -672,7 +672,6 @@ func makeOvhNativeRecord(name, target, rType string) *models.RecordConfig { r := makeRec(name, "", "TXT") r.Metadata = make(map[string]string) r.Metadata["create_ovh_native_record"] = rType - r.TxtStrings = []string{target} r.SetTarget(target) return r } diff --git a/providers/gcore/convert.go b/providers/gcore/convert.go index f3e4ebb5a..c3aec5efa 100644 --- a/providers/gcore/convert.go +++ b/providers/gcore/convert.go @@ -86,7 +86,7 @@ func recordsToNative(rcs []*models.RecordConfig, expectedKey models.RecordKey) * } case "TXT": // Avoid double quoting for TXT records rr = dnssdk.ResourceRecord{ - Content: convertTxtSliceToSdkAnySlice(r.TxtStrings), + Content: convertTxtSliceToSdkAnySlice([]string{r.GetTargetField()}), Meta: nil, Enabled: true, }