Skip to content

Commit

Permalink
Merge pull request #106508 from euank/20-09-k3s-CVE-2020-15257
Browse files Browse the repository at this point in the history
k3s: 1.18.12+k3s1 -> 1.18.12+k3s2
  • Loading branch information
flokli committed Dec 10, 2020
2 parents 65c9cc7 + 79bc493 commit 3446523
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions pkgs/applications/networking/cluster/k3s/default.nix
Expand Up @@ -42,9 +42,9 @@ 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.18.2+k3s1"; # k3s git tag
k3sVersion = "1.18.12+k3s2"; # k3s git tag
traefikChartVersion = "1.81.0"; # taken from ./scripts/download at the above k3s tag
k3sRootVersion = "0.3.0"; # taken from .s/cripts/download at the above k3s tag
k3sRootVersion = "0.4.1"; # taken from .s/cripts/download at the above k3s tag
# bundled into the k3s binary
traefikChart = fetchurl {
url = "https://kubernetes-charts.storage.googleapis.com/traefik-${traefikChartVersion}.tgz";
Expand All @@ -62,12 +62,12 @@ let
k3sRoot = fetchzip {
# Note: marked as apache 2.0 license
url = "https://github.com/rancher/k3s-root/releases/download/v${k3sRootVersion}/k3s-root-amd64.tar";
sha256 = "12xafn5jivl8lqdcs25b28xrc4mf7yf1xif5np169nvvxgvmpdxp";
sha256 = "0ppj8y9g410hn6mjkfgfsi2j9yv7rcpic21znpmbrkx8b2070hf0";
stripRoot = false;
};
k3sPlugins = buildGoPackage rec {
name = "k3s-cni-plugins";
version = "0.7.6-k3s1"; # from ./scripts/version.sh 'VERSION_CNIPLUGINS'; update when k3s's repo is updated.
version = "0.8.6-k3s1"; # from ./scripts/version.sh 'VERSION_CNIPLUGINS'; update when k3s's repo is updated.

goPackagePath = "github.com/containernetworking/plugins";
subPackages = [ "." ];
Expand All @@ -76,7 +76,7 @@ let
owner = "rancher";
repo = "plugins";
rev = "v${version}";
sha256 = "0ax72z1ziann352bp6khfds8vlf3bbkqckrkpx4l4jxgqks45izs";
sha256 = "13kx9msn5y9rw8v1p717wx0wbjqln59g6y3qfb1760aiwknva35q";
};

meta = {
Expand All @@ -93,7 +93,7 @@ let
url = "https://github.com/rancher/k3s";
rev = "v${k3sVersion}";
leaveDotGit = true; # ./scripts/version.sh depends on git
sha256 = "01ww3d71mlri2fk6z54rbd697aqwj942kbg323k0hfsnx7flkhps";
sha256 = "0xc4j6rnjzqgzcil6h4hkhvx7n0xwqrfny20ffnxk5zrbjdjw65f";
};
# Stage 1 of the k3s build:
# Let's talk about how k3s is structured.
Expand Down Expand Up @@ -156,8 +156,8 @@ let
platforms = platforms.linux;
};
};
k3sBuild = buildGoPackage rec {
name = "k3s-build";
k3sBin = buildGoPackage rec {
name = "k3s-bin";
version = "${k3sVersion}";

goPackagePath = "github.com/rancher/k3s";
Expand All @@ -167,7 +167,9 @@ let
patches = [ ./patches/0001-Use-rm-from-path-in-go-generate.patch ./patches/0002-Add-nixpkgs-patches.patch ];

nativeBuildInputs = [ git pkgconfig ];
buildInputs = [ k3sBuildStage1 k3sPlugins runc ];
# These dependencies are embedded as compressed files in k3s at runtime.
# Propagate them to avoid broken runtime references to libraries.
propagatedBuildInputs = [ k3sPlugins k3sBuildStage1 runc ];

# k3s appends a suffix to the final distribution binary for some arches
archSuffix =
Expand Down Expand Up @@ -236,7 +238,7 @@ stdenv.mkDerivation rec {
];

buildInputs = [
k3sBuild
k3sBin
makeWrapper
] ++ k3sRuntimeDeps;

Expand All @@ -250,7 +252,7 @@ stdenv.mkDerivation rec {
# execute, but that we didn't bundle with it.
installPhase = ''
mkdir -p "$out/bin"
makeWrapper ${k3sBuild}/bin/k3s "$out/bin/k3s" \
makeWrapper ${k3sBin}/bin/k3s "$out/bin/k3s" \
--prefix PATH : ${lib.makeBinPath k3sRuntimeDeps} \
--prefix PATH : "$out/bin"
'';
Expand Down

0 comments on commit 3446523

Please sign in to comment.