Merge pull request #11396 from dinever/fix-test-kubernetes-upgrade

Fix TestKubernetesUpgrade
pull/11405/head
Medya Ghazizadeh 2021-05-13 11:37:07 -07:00 committed by GitHub
commit 0b1e8cec51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -562,6 +562,7 @@ func updateExistingConfigFromFlags(cmd *cobra.Command, existing *config.ClusterC
updateIntFromFlag(cmd, &cc.SSHPort, sshSSHPort)
updateStringFromFlag(cmd, &cc.KubernetesConfig.Namespace, startNamespace)
updateStringFromFlag(cmd, &cc.KubernetesConfig.APIServerName, apiServerName)
updateStringSliceFromFlag(cmd, &cc.KubernetesConfig.APIServerNames, "apiserver-names")
updateStringFromFlag(cmd, &cc.KubernetesConfig.DNSDomain, dnsDomain)
updateStringFromFlag(cmd, &cc.KubernetesConfig.FeatureGates, featureGates)
updateStringFromFlag(cmd, &cc.KubernetesConfig.ContainerRuntime, containerRuntime)
@ -571,6 +572,10 @@ func updateExistingConfigFromFlags(cmd *cobra.Command, existing *config.ClusterC
updateBoolFromFlag(cmd, &cc.KubernetesConfig.ShouldLoadCachedImages, cacheImages)
updateIntFromFlag(cmd, &cc.KubernetesConfig.NodePort, apiServerPort)
if cmd.Flags().Changed(kubernetesVersion) {
cc.KubernetesConfig.KubernetesVersion = getKubernetesVersion(existing)
}
if cmd.Flags().Changed("extra-config") {
cc.KubernetesConfig.ExtraOptions = config.ExtraOptions
}

View File

@ -266,7 +266,7 @@ func TestKubernetesUpgrade(t *testing.T) {
}
if cv.ServerVersion.GitVersion != constants.NewestKubernetesVersion {
t.Fatalf("expected server version %s is not the same with latest version %s", cv.ServerVersion.GitVersion, constants.NewestKubernetesVersion)
t.Fatalf("server version %s is not the same with the expected version %s after upgrade", cv.ServerVersion.GitVersion, constants.NewestKubernetesVersion)
}
t.Logf("Attempting to downgrade Kubernetes (should fail)")