Change:
func TestVersionFromNetwork(t *testing.T) { type T struct { <del> Content       string Expected      string ErrorExpected bool </del> <ins> Content              string Expected             string FetcherErrorExpected bool ErrorExpected        bool </ins> } <ins> currentVersion := normalizedBuildVersion(constants.CurrentKubernetesVersion.String()) </ins> cases := map[string]T{ <del> "stable":     {"stable-1", "v1.4.6", false}, // recursive pointer to stable-1 "stable-1":   {"v1.4.6", "v1.4.6", false}, "stable-1.3": {"v1.3.10", "v1.3.10", false}, "latest":     {"v1.6.0-alpha.0", "v1.6.0-alpha.0", false}, "latest-1.3": {"v1.3.11-beta.0", "v1.3.11-beta.0", false}, "empty":      {"", "", true}, "garbage":    {"<?xml version='1.0'?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message></Error>", "", true}, "unknown":    {"The requested URL was not found on this server.", "", true}, </del> <ins> "stable":     {"stable-1", "v1.4.6", false, false}, // recursive pointer to stable-1 "stable-1":   {"v1.4.6", "v1.4.6", false, false}, "stable-1.3": {"v1.3.10", "v1.3.10", false, false}, "latest":     {"v1.6.0-alpha.0", "v1.6.0-alpha.0", false, false}, "latest-1.3": {"v1.3.11-beta.0", "v1.3.11-beta.0", false, false}, "empty":      {"", currentVersion, true, false}, "garbage":    {"<?xml version='1.0'?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message></Error>", currentVersion, true, false}, "unknown":    {"The requested URL was not found on this server.", currentVersion, true, false}, </ins> } for k, v := range cases {

Discussion:
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks! If the matter is security related, please disclose it privately via --What happened: I was using kubeadm to generate cluster ca: The CA generation failed because of 502 bad gateway returned and the response body isn't empty when it's trying to fetch stable version from internet. In this case, the function returns error instead of falling back to local client version: is how kubeadm fetches stable version and is how the error is handled for . Should kubeadm always fall back to client version when there is any internet issue? Otherwise, this sounds defeat the purpose of fallback. /sig cluster-lifecycle What you expected to happen: kubeadm falls back to local client version when there is any internet issue. How to reproduce it (as minimally and precisely as possible): Anything else we need to know?: Environment: Kubernetes version (use ): 1.13.7 Cloud provider or hardware configuration: OS (e.g: ): Kernel (e.g. ): Install tools: Network plugin and version (if this is a network-related bug): Others:
I'd like to take this issue. It would be better if you could give some directions. /assign
recreate the issue in kubernetes/kubeadm: /close
Closing this issue. <detailsIn response to : recreate the issue in kubernetes/kubeadm: Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
the fix will be removing the when failed to and add some unit test if I don't missing anything
Got it. Thanks.