about summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/rke2/default.nix
diff options
context:
space:
mode:
authorJonas Chevalier <zimbatm@zimbatm.com>2023-07-17 08:56:33 +0200
committerGitHub <noreply@github.com>2023-07-17 08:56:33 +0200
commit76f5020eb9c26e8d3ab6a946386d24b05136b89b (patch)
tree1f7005484a3b15388ec3197c47a95034e20eb001 /pkgs/applications/networking/cluster/rke2/default.nix
parent37c5762363db13576613afce4a76a0312f8c8f3f (diff)
rke2: 1.27.2+rke2r1 -> 1.27.3+rke2r1 (#243712)
* rke2: 1.27.2+rke2r1 -> 1.27.3+rke2r1

* rke2: fix embedded versions

Use the provided scripts to build the project, in order to minimize the
differences between the Nix and the upstream distribution.

Among other things, our build wasn't embedding the docker image tags in
the binary, and that resulted in the binary trying to load "latest"
images, failing in the process.

* rke2: add zimbatm as a maintainer
Diffstat (limited to 'pkgs/applications/networking/cluster/rke2/default.nix')
-rw-r--r--pkgs/applications/networking/cluster/rke2/default.nix24
1 files changed, 18 insertions, 6 deletions
diff --git a/pkgs/applications/networking/cluster/rke2/default.nix b/pkgs/applications/networking/cluster/rke2/default.nix
index c9ce55b0b19e1..66b1324a6b0ee 100644
--- a/pkgs/applications/networking/cluster/rke2/default.nix
+++ b/pkgs/applications/networking/cluster/rke2/default.nix
@@ -2,26 +2,38 @@
 
 buildGoModule rec {
   pname = "rke2";
-  version = "1.27.2+rke2r1";
+  version = "1.27.3+rke2r1";
 
   src = fetchFromGitHub {
     owner = "rancher";
     repo = pname;
     rev = "v${version}";
-    hash = "sha256-jzm2tYwsomLifAfmb0w1+/FpCgtOk+O8DRmy1OgzfmE=";
+    hash = "sha256-M/3F97iNeXdMMhs0eoPODeBC6Jp+yo/PwlPiG28SfYU=";
   };
 
-  vendorHash = "sha256-VVc1IgeR+LWEexTyIXtCcF6TtdDzsgP4U4kqArIKdU4=";
+  vendorHash = "sha256-7Za8PQr22kvZBvoYRVbI4bXUvGWkfILQC+kAmw9ZCro=";
 
-  subPackages = [ "." ];
+  postPatch = ''
+    # Patch the build scripts so they work in the Nix build environment.
+    patchShebangs ./scripts
 
-  ldflags = [ "-s" "-w" "-X github.com/k3s-io/k3s/pkg/version.Version=v${version}" ];
+    # Disable the static build as it breaks.
+    sed -e 's/STATIC_FLAGS=.*/STATIC_FLAGS=/g' -i scripts/build-binary
+  '';
+
+  buildPhase = ''
+    DRONE_TAG="v${version}" ./scripts/build-binary
+  '';
+
+  installPhase = ''
+    install -D ./bin/rke2 $out/bin/rke2
+  '';
 
   meta = with lib; {
     homepage = "https://github.com/rancher/rke2";
     description = "RKE2, also known as RKE Government, is Rancher's next-generation Kubernetes distribution.";
     changelog = "https://github.com/rancher/rke2/releases/tag/v${version}";
     license = licenses.asl20;
-    maintainers = with maintainers; [ zygot ];
+    maintainers = with maintainers; [ zimbatm zygot ];
   };
 }