Closed mhenderson-so closed 7 years ago
Almost certainly related to my recent re-factoring. Is this urgent?
Don't stress over it. Tom is looking into it, and they have a workaround.
I see the problem. It isn't related to apex records. There are 2 ways that a "create" Correlation is created in IncrementalDifff(). The 2nd one creates a RecordConfig with a nil .Origional, which confuses the namedotcom provider.
This is the code that generates the invalid Correlation:
providers/diff/diff.go
for _, desiredList := range desiredByNameAndType {
for _, rec := range desiredList {
fmt.Printf("DEBUG rec: %v\n", rec.Original)
// These rec's do not have a valid Desired.Original
create = append(create, Correlation{d, nil, rec})
}
}
A hack like this will let "preview" pass, but then "push" fails:
corrections = append(corrections, c)
}
for _, cre := range create {
- rec := cre.Desired.Original.(*models.RecordConfig)
+ var rec *models.RecordConfig
+ if cre.Desired.Original != nil {
+ rec = cre.Desired.Original.(*models.RecordConfig)
+ }
c := &models.Correction{Msg: cre.String(), F: func() error { return n.createRecord(rec, dc.Name) }}
Having two apex TXT records causes a panic. e.g. the following config:
causes panic: