mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
retain corefile when migration fails
This commit is contained in:
parent
badcd4af3f
commit
7074f28dd2
@ -238,7 +238,12 @@ func createCoreDNSAddon(deploymentBytes, serviceBytes, configBytes []byte, clien
|
|||||||
}
|
}
|
||||||
if IsCoreDNSConfigMapMigrationRequired(corefile) {
|
if IsCoreDNSConfigMapMigrationRequired(corefile) {
|
||||||
if err := migrateCoreDNSCorefile(client, coreDNSConfigMap, corefile, currentInstalledCoreDNSVersion); err != nil {
|
if err := migrateCoreDNSCorefile(client, coreDNSConfigMap, corefile, currentInstalledCoreDNSVersion); err != nil {
|
||||||
return err
|
// Errors in Corefile Migration is verified during preflight checks. This part will be executed when a user has chosen
|
||||||
|
// to ignore preflight check errors.
|
||||||
|
klog.Warningf("the CoreDNS Configuration was not migrated: %v. The existing CoreDNS Corefile configuration has been retained.", err)
|
||||||
|
if err := apiclient.CreateOrRetainConfigMap(client, coreDNSConfigMap, kubeadmconstants.CoreDNSConfigMap); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if err := apiclient.CreateOrUpdateConfigMap(client, coreDNSConfigMap); err != nil {
|
if err := apiclient.CreateOrUpdateConfigMap(client, coreDNSConfigMap); err != nil {
|
||||||
|
@ -108,7 +108,7 @@ func checkMigration(client clientset.Interface) error {
|
|||||||
|
|
||||||
_, err = migration.Migrate(currentInstalledCoreDNSversion, kubeadmconstants.CoreDNSVersion, corefile, false)
|
_, err = migration.Migrate(currentInstalledCoreDNSversion, kubeadmconstants.CoreDNSVersion, corefile, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return errors.Wrap(err, "the CoreDNS configuration will not be migrated, and may be incompatible with the upgraded version of CoreDNS")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user