Merge pull request #97620 from rajansandeep/patch-1

[kubeadm]: CoreDNS preflight: Parse correct version syntax
This commit is contained in:
Kubernetes Prow Robot 2021-01-05 04:49:58 -08:00 committed by GitHub
commit 42fe1d3405
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,7 @@ import (
"context" "context"
"fmt" "fmt"
"os" "os"
"strings"
"github.com/coredns/corefile-migration/migration" "github.com/coredns/corefile-migration/migration"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -116,7 +117,7 @@ func checkMigration(client clientset.Interface) error {
return err return err
} }
_, err = migration.Migrate(currentInstalledCoreDNSversion, kubeadmconstants.CoreDNSVersion, corefile, false) _, err = migration.Migrate(currentInstalledCoreDNSversion, strings.TrimLeft(kubeadmconstants.CoreDNSVersion, "v"), corefile, false)
if err != nil { if err != nil {
return errors.Wrap(err, "CoreDNS will not be upgraded") return errors.Wrap(err, "CoreDNS will not be upgraded")
} }