summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorThiago Kenji Okada <thiagokokada@gmail.com>2022-04-13 16:37:50 +0100
committerGitHub <noreply@github.com>2022-04-13 16:37:50 +0100
commit6ed604af510c9ae7a800bbb35ca3a723e2db2287 (patch)
tree3e822708006c8edba735467f71ab22264d5eb794 /pkgs/applications
parentbadbd95a5cd26a6d5e2dd0b82ec39877d4b7a442 (diff)
parentf8dc166d73cdee0bb477fafbaced576d6c4ec023 (diff)
downloadnixpkgs-6ed604af510c9ae7a800bbb35ca3a723e2db2287.tar
nixpkgs-6ed604af510c9ae7a800bbb35ca3a723e2db2287.tar.gz
nixpkgs-6ed604af510c9ae7a800bbb35ca3a723e2db2287.tar.bz2
nixpkgs-6ed604af510c9ae7a800bbb35ca3a723e2db2287.tar.lz
nixpkgs-6ed604af510c9ae7a800bbb35ca3a723e2db2287.tar.xz
nixpkgs-6ed604af510c9ae7a800bbb35ca3a723e2db2287.tar.zst
nixpkgs-6ed604af510c9ae7a800bbb35ca3a723e2db2287.zip
Merge pull request #168390 from superherointj/package-k3s-1.23.5+k3s1
k3s: 1.23.4+k3s1 -> 1.23.5+k3s1
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/networking/cluster/k3s/default.nix31
-rw-r--r--pkgs/applications/networking/cluster/k3s/patches/0002-Don-t-build-a-static-binary-in-package-cli.patch37
2 files changed, 23 insertions, 45 deletions
diff --git a/pkgs/applications/networking/cluster/k3s/default.nix b/pkgs/applications/networking/cluster/k3s/default.nix
index fa355b65131..aeca62764f0 100644
--- a/pkgs/applications/networking/cluster/k3s/default.nix
+++ b/pkgs/applications/networking/cluster/k3s/default.nix
@@ -46,12 +46,12 @@ with lib;
 # Those pieces of software we entirely ignore upstream's handling of, and just
 # make sure they're in the path if desired.
 let
-  k3sVersion = "1.23.4+k3s1";     # k3s git tag
-  k3sCommit = "43b1cb48200d8f6af85c16ed944d68fcc96b6506"; # k3s git commit at the above version
-  k3sRepoSha256 = "1sn7rd5hqfqvwj036blk0skmq6r8igbmiqk1dnpaqnkkddpzdgmc";
-  k3sVendorSha256 = "sha256-1/kQvNqFUWwch1JH+twWzBdjNYseoZyVObB1+s9WPM4=";
+  k3sVersion = "1.23.5+k3s1";     # k3s git tag
+  k3sCommit = "313aaca547f030752788dce696fdf8c9568bc035"; # k3s git commit at the above version
+  k3sRepoSha256 = "0vk72609cyyh64irp14jp2zspnxw34jm710cbwgklx0ch6kiz88d";
+  k3sVendorSha256 = "sha256-d7kQsJi/eQbaTUDglp3gFpc5Im6CyD9coKeM3kMrbjI=";
 
-  k3sServerVendorSha256 = "sha256-2KIFff43jfqWdxX61aWofrjmc5mMkr5aEJRFdGpLyU8=";
+  k3sServerVendorSha256 = "sha256-E3USXNuXY0lzZH+t3O7BOQ8rKNNQ6avOMItgOEi1cEg=";
 
   # taken from ./manifests/traefik.yaml, extracted from '.spec.chart' https://github.com/k3s-io/k3s/blob/v1.23.3%2Bk3s1/scripts/download#L9
   # The 'patch' and 'minor' versions are currently hardcoded as single digits only, so ignore the trailing two digits. Weird, I know.
@@ -68,8 +68,8 @@ let
 
   # taken from go.mod, the 'github.com/containerd/containerd' line
   # run `grep github.com/containerd/containerd go.mod | head -n1 | awk '{print $4}'`
-  containerdVersion = "1.5.9-k3s1";
-  containerdSha256 = "09wfy20z3c9fnla353pibpsb10xzl0f4xwp8qdjh3fwa1q2626gg";
+  containerdVersion = "1.5.10-k3s1";
+  containerdSha256 = "1ff2sfaqpjimq7w0lprci6ibyi6v65ap6b9sr6b0j12gqr2sqwa5";
 
   # run `grep github.com/kubernetes-sigs/cri-tools go.mod | head -n1 | awk '{print $4}'` in the k3s repo at the tag
   criCtlVersion = "1.22.0-k3s1";
@@ -228,9 +228,24 @@ buildGoModule rec {
 
   patches = [
     ./patches/0001-scrips-download-strip-downloading-just-package-CRD.patch
-    ./patches/0002-Don-t-build-a-static-binary-in-package-cli.patch
   ];
 
+  postPatch = ''
+    # Nix prefers dynamically linked binaries over static binary.
+
+    substituteInPlace scripts/package-cli \
+      --replace '"$LDFLAGS $STATIC" -o' \
+                '"$LDFLAGS" -o' \
+      --replace "STATIC=\"-extldflags \'-static\'\"" \
+                ""
+
+    # Upstream codegen fails with trimpath set. Removes "trimpath" for 'go generate':
+
+    substituteInPlace scripts/package-cli \
+      --replace '"''${GO}" generate' \
+                'GOFLAGS="" "''${GO}" generate'
+  '';
+
   # Important utilities used by the kubelet, see
   # https://github.com/kubernetes/kubernetes/issues/26093#issuecomment-237202494
   # Note the list in that issue is stale and some aren't relevant for k3s.
diff --git a/pkgs/applications/networking/cluster/k3s/patches/0002-Don-t-build-a-static-binary-in-package-cli.patch b/pkgs/applications/networking/cluster/k3s/patches/0002-Don-t-build-a-static-binary-in-package-cli.patch
deleted file mode 100644
index 886b6ec7409..00000000000
--- a/pkgs/applications/networking/cluster/k3s/patches/0002-Don-t-build-a-static-binary-in-package-cli.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 49c000c7c5dd7a502a2be4c638d2c32b65673c00 Mon Sep 17 00:00:00 2001
-From: Euan Kemp <euank@euank.com>
-Date: Sun, 6 Feb 2022 23:13:00 -0800
-Subject: [PATCH] Don't build a static binary in package-cli
-
-since nixpkgs prefers dynamically linked binaries.
-
-Also remove "trimpath" for the 'go generate' step because the codegen
-they use doesn't work with trimpath set.
----
- scripts/package-cli | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/scripts/package-cli b/scripts/package-cli
-index 28927327b7..95dbb469f1 100755
---- a/scripts/package-cli
-+++ b/scripts/package-cli
-@@ -48,14 +48,13 @@ fi
- 
- CMD_NAME=dist/artifacts/k3s${BIN_SUFFIX}
- 
--"${GO}" generate
-+GOFLAGS="" "${GO}" generate
- LDFLAGS="
-     -X github.com/rancher/k3s/pkg/version.Version=$VERSION
-     -X github.com/rancher/k3s/pkg/version.GitCommit=${COMMIT:0:8}
-     -w -s
- "
--STATIC="-extldflags '-static'"
--CGO_ENABLED=0 "${GO}" build -ldflags "$LDFLAGS $STATIC" -o ${CMD_NAME} ./cmd/k3s/main.go
-+CGO_ENABLED=0 "${GO}" build -ldflags "$LDFLAGS" -o ${CMD_NAME} ./cmd/k3s/main.go
- 
- stat ${CMD_NAME}
- 
--- 
-2.34.1
-