k8s migration: add handler for multi proxy to forward (#164)

add global postprocess and handler for multi proxy to forward
This commit is contained in:
Chris O'Haver 2019-05-13 16:23:53 -04:00 committed by GitHub
parent 709b136563
commit d7f87ddf2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 129 additions and 15 deletions

View file

@ -200,7 +200,17 @@ func Migrate(fromCoreDNSVersion, toCoreDNSVersion, corefileStr string, deprecati
newSrvs = append(newSrvs, newSrv)
}
cf = corefile.Corefile{Servers: newSrvs}
cf = &corefile.Corefile{Servers: newSrvs}
// apply any global corefile level post processing
if Versions[v].postProcess != nil {
cf, err = Versions[v].postProcess(cf)
if err != nil {
return "", err
}
}
if v == toCoreDNSVersion {
break
}