const getReleaseVersionTimeout … var kubeReleaseBucketURL … var kubeCIBucketURL … var kubeReleaseRegex … var kubeReleaseLabelRegex … var kubeBucketPrefixes … var KubernetesReleaseVersion … // kubernetesReleaseVersionDefault is helper function that can fetch // available version information from release servers based on // label names, like "stable" or "latest". // // If argument is already semantic version string, it // will return same string. // // In case of labels, it tries to fetch from release // servers and then return actual semantic version. // // Available names on release servers: // // stable (latest stable release) // stable-1 (latest stable release in 1.x) // stable-1.0 (and similarly 1.1, 1.2, 1.3, ...) // latest (latest release, including alpha/beta) // latest-1 (latest release in 1.x, including alpha/beta) // latest-1.0 (and similarly 1.1, 1.2, 1.3, ...) func kubernetesReleaseVersionDefault(version string) (string, error) { … } // kubernetesReleaseVersion is a helper function to fetch // available version information. Used for testing to eliminate // the need for internet calls. func kubernetesReleaseVersion(version string, fetcher func(string, time.Duration) (string, error)) (string, error) { … } // KubernetesVersionToImageTag is helper function that replaces all // non-allowed symbols in tag strings with underscores. // Image tag can only contain lowercase and uppercase letters, digits, // underscores, periods and dashes. // Current usage is for CI images where all of symbols except '+' are valid, // but function is for generic usage where input can't be always pre-validated. func KubernetesVersionToImageTag(version string) string { … } // KubernetesIsCIVersion checks if user requested CI version func KubernetesIsCIVersion(version string) bool { … } // Internal helper: returns normalized build version (with "v" prefix if needed) // If input doesn't match known version pattern, returns empty string. func normalizedBuildVersion(version string) string { … } // Internal helper: split version parts, // Return base URL and cleaned-up version func splitVersion(version string) (string, string, error) { … } // Internal helper: return content of URL func fetchFromURL(url string, timeout time.Duration) (string, error) { … } // kubeadmVersion returns the version of the client without metadata. func kubeadmVersion(info string) (string, error) { … } // Validate if the remote version is one Minor release newer than the client version. // This is done to conform with "stable-X" and only allow remote versions from // the same Patch level release. func validateStableVersion(remoteVersion, clientVersion string) (string, error) { … }