diff --git a/pkgs/applications/networking/cluster/kubernetes/default.nix b/pkgs/applications/networking/cluster/kubernetes/default.nix index e2f431e2a5e5..341abf98739d 100644 --- a/pkgs/applications/networking/cluster/kubernetes/default.nix +++ b/pkgs/applications/networking/cluster/kubernetes/default.nix @@ -29,6 +29,11 @@ stdenv.mkDerivation rec { outputs = ["out" "man" "pause"]; + # patch broken go version check, see issue #35403 + # patch is from https://github.com/kubernetes/kubernetes/pull/58207 + #TODO: patch already merged upstream - remove for next k8s version + patches = [ ./go-version-check.patch ]; + postPatch = '' substituteInPlace "hack/lib/golang.sh" --replace "_cgo" "" substituteInPlace "hack/generate-docs.sh" --replace "make" "make SHELL=${stdenv.shell}" diff --git a/pkgs/applications/networking/cluster/kubernetes/go-version-check.patch b/pkgs/applications/networking/cluster/kubernetes/go-version-check.patch new file mode 100644 index 000000000000..e3040cbb70ff --- /dev/null +++ b/pkgs/applications/networking/cluster/kubernetes/go-version-check.patch @@ -0,0 +1,11 @@ +--- a/hack/lib/golang.sh ++++ b/hack/lib/golang.sh +@@ -323,7 +323,7 @@ EOF + go_version=($(go version)) + local minimum_go_version + minimum_go_version=go1.9.1 +- if [[ "${go_version[2]}" < "${minimum_go_version}" && "${go_version[2]}" != "devel" ]]; then ++ if [[ "${minimum_go_version}" != $(echo -e "${minimum_go_version}\n${go_version[2]}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) && "${go_version[2]}" != "devel" ]]; then + kube::log::usage_from_stdin <