diff --git a/cmd/kubeadm/app/phases/addons/dns/dns.go b/cmd/kubeadm/app/phases/addons/dns/dns.go index 5cdcb9f3259..5e4355de025 100644 --- a/cmd/kubeadm/app/phases/addons/dns/dns.go +++ b/cmd/kubeadm/app/phases/addons/dns/dns.go @@ -408,7 +408,7 @@ func migrateCoreDNSCorefile(client clientset.Interface, cm *v1.ConfigMap, corefi }, metav1.UpdateOptions{}); err != nil { return errors.Wrap(err, "unable to update the CoreDNS ConfigMap") } - fmt.Println("[addons]: Migrating CoreDNS Corefile") + fmt.Println("[addons] Migrating CoreDNS Corefile") changes, err := migration.Deprecated(currentInstalledCoreDNSVersion, kubeadmconstants.CoreDNSVersion, corefile) if err != nil { return errors.Wrap(err, "unable to get list of changes to the configuration.") diff --git a/cmd/kubeadm/app/phases/upgrade/preflight.go b/cmd/kubeadm/app/phases/upgrade/preflight.go index e7b50c93fcb..0351650ccf3 100644 --- a/cmd/kubeadm/app/phases/upgrade/preflight.go +++ b/cmd/kubeadm/app/phases/upgrade/preflight.go @@ -17,6 +17,7 @@ limitations under the License. package upgrade import ( + "fmt" "os" "github.com/coredns/corefile-migration/migration" @@ -80,20 +81,21 @@ func checkUnsupportedPlugins(client clientset.Interface) error { if err != nil { return err } - unsupportedCoreDNS, err := migration.Unsupported(currentInstalledCoreDNSversion, kubeadmconstants.CoreDNSVersion, corefile) + unsupportedCoreDNS, err := migration.Unsupported(currentInstalledCoreDNSversion, currentInstalledCoreDNSversion, corefile) if err != nil { return err } if unsupportedCoreDNS != nil { - var UnsupportedPlugins, UnsupportedVersion string + var UnsupportedPlugins []string for _, unsup := range unsupportedCoreDNS { - UnsupportedPlugins = unsup.Plugin - UnsupportedVersion = unsup.Version - - } - if UnsupportedPlugins != "" || UnsupportedVersion != "" { - return errors.New("there are unsupported plugins in the CoreDNS Corefile") + UnsupportedPlugins = append(UnsupportedPlugins, unsup.ToString()) } + fmt.Println("[preflight] The corefile contains plugins that kubeadm/CoreDNS does not know how to migrate. " + + "Each plugin listed should be manually verified for compatibility with the newer version of CoreDNS. " + + "Once ready, the upgrade can be initiated by skipping the preflight check. During the upgrade, " + + "kubeadm will migrate the configuration while leaving the listed plugin configs untouched, " + + "but cannot guarantee that they will work with the newer version of CoreDNS.") + return errors.Errorf("CoreDNS cannot migrate the following plugins:\n%s", UnsupportedPlugins) } return nil }