kubeadm: no need to check if target coredns version is not changed

This commit is contained in:
Paco Xu 2023-02-25 21:53:28 +08:00
parent 744d9bfda3
commit b1ee8c8b82
2 changed files with 10 additions and 2 deletions

View File

@ -285,7 +285,11 @@ func isCoreDNSConfigMapMigrationRequired(corefile, currentInstalledCoreDNSVersio
return isMigrationRequired, nil return isMigrationRequired, nil
} }
currentInstalledCoreDNSVersion = strings.TrimLeft(currentInstalledCoreDNSVersion, "v") currentInstalledCoreDNSVersion = strings.TrimLeft(currentInstalledCoreDNSVersion, "v")
deprecated, err := migration.Deprecated(currentInstalledCoreDNSVersion, strings.TrimLeft(kubeadmconstants.CoreDNSVersion, "v"), corefile) targetCoreDNSVersion := strings.TrimLeft(kubeadmconstants.CoreDNSVersion, "v")
if currentInstalledCoreDNSVersion == targetCoreDNSVersion {
return isMigrationRequired, nil
}
deprecated, err := migration.Deprecated(currentInstalledCoreDNSVersion, targetCoreDNSVersion, corefile)
if err != nil { if err != nil {
return isMigrationRequired, errors.Wrap(err, "unable to get list of changes to the configuration.") return isMigrationRequired, errors.Wrap(err, "unable to get list of changes to the configuration.")
} }

View File

@ -81,7 +81,11 @@ func checkUnsupportedPlugins(client clientset.Interface) error {
} }
currentInstalledCoreDNSversion = strings.TrimLeft(currentInstalledCoreDNSversion, "v") currentInstalledCoreDNSversion = strings.TrimLeft(currentInstalledCoreDNSversion, "v")
unsupportedCoreDNS, err := migration.Unsupported(currentInstalledCoreDNSversion, currentInstalledCoreDNSversion, corefile) targetCoreDNSVersion := strings.TrimLeft(kubeadmconstants.CoreDNSVersion, "v")
if currentInstalledCoreDNSversion == targetCoreDNSVersion {
return nil
}
unsupportedCoreDNS, err := migration.Unsupported(currentInstalledCoreDNSversion, targetCoreDNSVersion, corefile)
if err != nil { if err != nil {
return err return err
} }