mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
NEW FEATURE: NO_PURGE reports what is not purged (diff2 only) (#2031)
This commit is contained in:
@@ -158,6 +158,7 @@ func (c *gcoreProvider) GenerateDomainCorrections(dc *models.DomainConfig, exist
|
||||
// Make delete happen earlier than creates & updates.
|
||||
var corrections []*models.Correction
|
||||
var deletions []*models.Correction
|
||||
var reports []*models.Correction
|
||||
|
||||
if !diff2.EnableDiff2 {
|
||||
|
||||
@@ -246,6 +247,8 @@ func (c *gcoreProvider) GenerateDomainCorrections(dc *models.DomainConfig, exist
|
||||
msg := generateChangeMsg(change.Msgs)
|
||||
|
||||
switch change.Type {
|
||||
case diff2.REPORT:
|
||||
corrections = append(corrections, &models.Correction{Msg: change.MsgsJoined})
|
||||
case diff2.CREATE:
|
||||
corrections = append(corrections, &models.Correction{
|
||||
Msg: msg,
|
||||
@@ -267,9 +270,13 @@ func (c *gcoreProvider) GenerateDomainCorrections(dc *models.DomainConfig, exist
|
||||
return c.provider.DeleteRRSet(c.ctx, zone, name, typ)
|
||||
},
|
||||
})
|
||||
default:
|
||||
panic(fmt.Sprintf("unhandled change.Type %s", change.Type))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return append(deletions, corrections...), nil
|
||||
result := append(reports, deletions...)
|
||||
result = append(result, corrections...)
|
||||
return result, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user