summary refs log tree commit diff
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-07-13 22:42:19 +0200
committerGitHub <noreply@github.com>2021-07-13 22:42:19 +0200
commita5ba4fd809548e1f7144a024d208438bf160d7f0 (patch)
treebc5cca37f871cbddb5931389a33c8cf61bc6aeb4
parenta5705a8efbe30c33d05f0e1cde5b6f6217aa7d03 (diff)
parent5494ab9fde91f7952645b15bf7a916a664c1cbde (diff)
downloadnixpkgs-a5ba4fd809548e1f7144a024d208438bf160d7f0.tar
nixpkgs-a5ba4fd809548e1f7144a024d208438bf160d7f0.tar.gz
nixpkgs-a5ba4fd809548e1f7144a024d208438bf160d7f0.tar.bz2
nixpkgs-a5ba4fd809548e1f7144a024d208438bf160d7f0.tar.lz
nixpkgs-a5ba4fd809548e1f7144a024d208438bf160d7f0.tar.xz
nixpkgs-a5ba4fd809548e1f7144a024d208438bf160d7f0.tar.zst
nixpkgs-a5ba4fd809548e1f7144a024d208438bf160d7f0.zip
Merge pull request #130025 from superherointj/package-k3s-v1.21.2+k3s1
-rw-r--r--pkgs/applications/networking/cluster/k3s/default.nix6
-rw-r--r--pkgs/applications/networking/cluster/k3s/patches/0002-Add-nixpkgs-patches.patch41
2 files changed, 22 insertions, 25 deletions
diff --git a/pkgs/applications/networking/cluster/k3s/default.nix b/pkgs/applications/networking/cluster/k3s/default.nix
index 878d7e1184f..dfeb61915ee 100644
--- a/pkgs/applications/networking/cluster/k3s/default.nix
+++ b/pkgs/applications/networking/cluster/k3s/default.nix
@@ -44,8 +44,8 @@ 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.21.0+k3s1";     # k3s git tag
-  k3sCommit = "2705431d9645d128441c578309574cd262285ae6"; # k3s git commit at the above version
+  k3sVersion = "1.21.2+k3s1";     # k3s git tag
+  k3sCommit = "5a67e8dc473f8945e8e181f6f0b0dbbc387f6fca"; # k3s git commit at the above version
 
   traefikChartVersion = "9.18.2"; # taken from ./scripts/download at TRAEFIK_VERSION
   k3sRootVersion = "0.8.1";       # taken from ./scripts/download at ROOT_VERSION
@@ -97,7 +97,7 @@ let
   k3sRepo = fetchgit {
     url = "https://github.com/k3s-io/k3s";
     rev = "v${k3sVersion}";
-    sha256 = "sha256-xsXxf2ZYrkpOHlSFqTsHwWF3kChUjxWRjyDR3Dhg2ho=";
+    sha256 = "sha256-ZRkdHQ4RJ6XqE+DKE6wwpxetuKDG3k/4HaHyFxHev1U=";
   };
   # Stage 1 of the k3s build:
   # Let's talk about how k3s is structured.
diff --git a/pkgs/applications/networking/cluster/k3s/patches/0002-Add-nixpkgs-patches.patch b/pkgs/applications/networking/cluster/k3s/patches/0002-Add-nixpkgs-patches.patch
index 244da314f59..dd26810a456 100644
--- a/pkgs/applications/networking/cluster/k3s/patches/0002-Add-nixpkgs-patches.patch
+++ b/pkgs/applications/networking/cluster/k3s/patches/0002-Add-nixpkgs-patches.patch
@@ -1,21 +1,19 @@
-From 1891be119e298ef7c86347a6b74d40ff539cf06e Mon Sep 17 00:00:00 2001
-From: Euan Kemp <euank@euank.com>
-Date: Sun, 31 May 2020 19:02:37 -0700
-Subject: [PATCH 2/2] Add nixpkgs patches
-
-These patches let us re-use the upstream build scripts when building for
-nix.
----
- scripts/build       | 20 ++++----------------
- scripts/package-cli | 10 ++++++----
- 2 files changed, 10 insertions(+), 20 deletions(-)
-
+-Subject: [PATCH 2/2] Add nixpkgs patches
+-Original patch by: Euan Kemp <euank@euank.com>
+-Adapted by: superherointj
+-
+-This patch allows us to re-use upstream build scripts when building for nix.
+----
+- 2 files changed:
+-   scripts/build
+-   scripts/package-cli
+-
 diff --git a/scripts/build b/scripts/build
-index 4ca6333c4a..df15f7db1d 100755
+index 2f3d1dc496..4f4e5aa897 100755
 --- a/scripts/build
 +++ b/scripts/build
 @@ -12,7 +12,8 @@ PKG_CONTAINERD="github.com/containerd/containerd"
- PKG_RANCHER_CONTAINERD="github.com/rancher/containerd"
+ PKG_K3S_CONTAINERD="github.com/k3s-io/containerd"
  PKG_CRICTL="github.com/kubernetes-sigs/cri-tools"
  
 -buildDate=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
@@ -24,7 +22,7 @@ index 4ca6333c4a..df15f7db1d 100755
  
  VENDOR_PREFIX="${PKG}/vendor/"
  VERSIONFLAGS="
-@@ -92,17 +93,7 @@ cleanup() {
+@@ -89,17 +90,7 @@ cleanup() {
  }
  
  INSTALLBIN=$(pwd)/bin
@@ -43,23 +41,23 @@ index 4ca6333c4a..df15f7db1d 100755
  # echo Building agent
  # CGO_ENABLED=1 "${GO}" build -tags "$TAGS" -ldflags "$VERSIONFLAGS $LDFLAGS $STATIC" -o bin/k3s-agent ./cmd/agent/main.go
  echo Building server
-@@ -118,10 +109,7 @@ ln -s containerd ./bin/ctr
+@@ -116,10 +107,7 @@ ln -s containerd ./bin/ctr
  #CGO_ENABLED=1 "${GO}" build -tags "$TAGS" -ldflags "$VERSIONFLAGS $LDFLAGS $STATIC_SQLITE" -o bin/ctr ./cmd/ctr/main.go
  # echo Building containerd
  # CGO_ENABLED=0 "${GO}" build -tags "$TAGS" -ldflags "$VERSIONFLAGS $LDFLAGS $STATIC" -o bin/containerd ./cmd/containerd/
 -echo Building runc
--rm -f ./vendor/github.com/opencontainers/runc/runc
--make EXTRA_LDFLAGS="-w -s" BUILDTAGS="$RUNC_TAGS" -C ./vendor/github.com/opencontainers/runc $RUNC_STATIC
--cp -f ./vendor/github.com/opencontainers/runc/runc ./bin/runc
+-rm -f ./build/src/github.com/opencontainers/runc/runc
+-make GOPATH=$(pwd)/build EXTRA_LDFLAGS="-w -s" BUILDTAGS="$RUNC_TAGS" -C ./build/src/github.com/opencontainers/runc $RUNC_STATIC
+-cp -f ./build/src/github.com/opencontainers/runc/runc ./bin/runc
 +# nixpkgs: we build runc separately
  
  echo Building containerd-shim
  rm -f ./vendor/github.com/containerd/containerd/bin/containerd-shim
 diff --git a/scripts/package-cli b/scripts/package-cli
-index d1aad638d9..90479b6fa1 100755
+index ab4a6dac63..044b5587d0 100755
 --- a/scripts/package-cli
 +++ b/scripts/package-cli
-@@ -49,15 +49,18 @@ fi
+@@ -50,15 +50,17 @@ fi
  
  CMD_NAME=dist/artifacts/k3s${BIN_SUFFIX}
  
@@ -81,4 +79,3 @@ index d1aad638d9..90479b6fa1 100755
 -./scripts/build-upload ${CMD_NAME} ${COMMIT}
 +# nixpkgs: skip uploading
 +# ./scripts/build-upload ${CMD_NAME} ${COMMIT}
-+