about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/cluster/kubernetes/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/cluster/kubernetes/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/networking/cluster/kubernetes/default.nix45
1 files changed, 18 insertions, 27 deletions
diff --git a/nixpkgs/pkgs/applications/networking/cluster/kubernetes/default.nix b/nixpkgs/pkgs/applications/networking/cluster/kubernetes/default.nix
index e4203f0028ad..6b006a507b82 100644
--- a/nixpkgs/pkgs/applications/networking/cluster/kubernetes/default.nix
+++ b/nixpkgs/pkgs/applications/networking/cluster/kubernetes/default.nix
@@ -1,11 +1,11 @@
-{ stdenv
-, lib
+{ lib
+, buildGoModule
 , fetchFromGitHub
 , which
-, go
 , makeWrapper
 , rsync
 , installShellFiles
+, runtimeShell
 , kubectl
 , nixosTests
 
@@ -19,42 +19,38 @@
   ]
 }:
 
-stdenv.mkDerivation rec {
+buildGoModule rec {
   pname = "kubernetes";
-  version = "1.23.5";
+  version = "1.23.10";
 
   src = fetchFromGitHub {
     owner = "kubernetes";
     repo = "kubernetes";
     rev = "v${version}";
-    sha256 = "sha256-LhJ3gThcsWnawSOmHSzWOG8tfODIPo4dJTMeLKmvMdM=";
+    sha256 = "sha256-ujSy6akbk4SvMIQdBJkNMwaRNEfFKJmVrN3lNtFudkA=";
   };
 
-  nativeBuildInputs = [ makeWrapper which go rsync installShellFiles ];
+  vendorSha256 = null;
 
-  outputs = [ "out" "man" "pause" ];
-
-  patches = [ ./fixup-addonmanager-lib-path.patch ];
+  doCheck = false;
 
-  postPatch = ''
-    # go env breaks the sandbox
-    substituteInPlace "hack/lib/golang.sh" \
-      --replace 'echo "$(go env GOHOSTOS)/$(go env GOHOSTARCH)"' 'echo "${go.GOOS}/${go.GOARCH}"'
+  nativeBuildInputs = [ makeWrapper which rsync installShellFiles ];
 
-    substituteInPlace "hack/update-generated-docs.sh" --replace "make" "make SHELL=${stdenv.shell}"
-    # hack/update-munge-docs.sh only performs some tests on the documentation.
-    # They broke building k8s; disabled for now.
-    echo "true" > "hack/update-munge-docs.sh"
+  outputs = [ "out" "man" "pause" ];
 
-    patchShebangs ./hack
-  '';
+  patches = [ ./fixup-addonmanager-lib-path.patch ];
 
   WHAT = lib.concatStringsSep " " ([
     "cmd/kubeadm"
   ] ++ components);
 
-  postBuild = ''
+  buildPhase = ''
+    runHook preBuild
+    substituteInPlace "hack/update-generated-docs.sh" --replace "make" "make SHELL=${runtimeShell}"
+    patchShebangs ./hack ./cluster/addons/addon-manager
+    make "SHELL=${runtimeShell}" "WHAT=$WHAT"
     ./hack/update-generated-docs.sh
+    runHook postBuild
   '';
 
   installPhase = ''
@@ -77,7 +73,6 @@ stdenv.mkDerivation rec {
       --subst-var out
 
     chmod +x $out/bin/kube-addons
-    patchShebangs $out/bin/kube-addons
     wrapProgram $out/bin/kube-addons --set "KUBECTL_BIN" "$out/bin/kubectl"
 
     cp cluster/addons/addon-manager/kube-addons.sh $out/bin/kube-addons-lib.sh
@@ -88,10 +83,6 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  disallowedReferences = [ go ];
-
-  GOFLAGS = [ "-trimpath" ];
-
   meta = with lib; {
     description = "Production-Grade Container Scheduling and Management";
     license = licenses.asl20;
@@ -100,5 +91,5 @@ stdenv.mkDerivation rec {
     platforms = platforms.linux;
   };
 
-  passthru.tests = nixosTests.kubernetes;
+  passthru.tests = nixosTests.kubernetes // { inherit kubectl; };
 }