Merge pull request #122514 from superherointj/package-k3s-v1.21.0+k3s1

k3s: 1.20.6+k3s1 -> 1.21.0+k3s1
This commit is contained in:
Jörg Thalheim 2021-05-12 14:34:38 +01:00 committed by GitHub
commit e2d88e0ae3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,14 +44,16 @@ with lib;
# Those pieces of software we entirely ignore upstream's handling of, and just # Those pieces of software we entirely ignore upstream's handling of, and just
# make sure they're in the path if desired. # make sure they're in the path if desired.
let let
k3sVersion = "1.20.6+k3s1"; # k3s git tag k3sVersion = "1.21.0+k3s1"; # k3s git tag
traefikChartVersion = "1.81.0"; # taken from ./scripts/download at the above k3s tag k3sCommit = "2705431d9645d128441c578309574cd262285ae6"; # k3s git commit at the above version
k3sRootVersion = "0.8.1"; # taken from ./scripts/download at the above k3s tag
k3sCNIVersion = "0.8.6-k3s1"; # taken from ./scripts/version.sh at the above k3s tag traefikChartVersion = "9.18.2"; # taken from ./scripts/download at TRAEFIK_VERSION
k3sRootVersion = "0.8.1"; # taken from ./scripts/download at ROOT_VERSION
k3sCNIVersion = "0.8.6-k3s1"; # taken from ./scripts/version.sh at VERSION_CNIPLUGINS
# bundled into the k3s binary # bundled into the k3s binary
traefikChart = fetchurl { traefikChart = fetchurl {
url = "https://kubernetes-charts.storage.googleapis.com/traefik-${traefikChartVersion}.tgz"; url = "https://helm.traefik.io/traefik/traefik-${traefikChartVersion}.tgz";
sha256 = "1aqpzgjlvqhil0g3angz94zd4xbl4iq0qmpjcy5aq1xv9qciwdi9"; sha256 = "sha256-9d7p0ngyMN27u4OPgz7yI14Zj9y36t9o/HMX5wyDpUI=";
}; };
# so, k3s is a complicated thing to package # so, k3s is a complicated thing to package
# This derivation attempts to avoid including any random binaries from the # This derivation attempts to avoid including any random binaries from the
@ -95,8 +97,7 @@ let
k3sRepo = fetchgit { k3sRepo = fetchgit {
url = "https://github.com/k3s-io/k3s"; url = "https://github.com/k3s-io/k3s";
rev = "v${k3sVersion}"; rev = "v${k3sVersion}";
leaveDotGit = true; # ./scripts/version.sh depends on git sha256 = "sha256-xsXxf2ZYrkpOHlSFqTsHwWF3kChUjxWRjyDR3Dhg2ho=";
sha256 = "sha256-IIZotJKQ/+WNmfcEJU5wFtZBufWjUp4MeVCRk4tSjyQ=";
}; };
# Stage 1 of the k3s build: # Stage 1 of the k3s build:
# Let's talk about how k3s is structured. # Let's talk about how k3s is structured.
@ -134,9 +135,13 @@ let
# those. # those.
patches = [ ./patches/0002-Add-nixpkgs-patches.patch ]; patches = [ ./patches/0002-Add-nixpkgs-patches.patch ];
nativeBuildInputs = [ git pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ libseccomp ]; buildInputs = [ libseccomp ];
# Versioning info for build script
DRONE_TAG = "v${version}";
DRONE_COMMIT = k3sCommit;
buildPhase = '' buildPhase = ''
pushd go/src/${goPackagePath} pushd go/src/${goPackagePath}
@ -175,7 +180,7 @@ let
# See the above comment in k3sBuildStage1 # See the above comment in k3sBuildStage1
patches = [ ./patches/0002-Add-nixpkgs-patches.patch ]; patches = [ ./patches/0002-Add-nixpkgs-patches.patch ];
nativeBuildInputs = [ git pkg-config zstd ]; nativeBuildInputs = [ pkg-config zstd ];
# These dependencies are embedded as compressed files in k3s at runtime. # These dependencies are embedded as compressed files in k3s at runtime.
# Propagate them to avoid broken runtime references to libraries. # Propagate them to avoid broken runtime references to libraries.
propagatedBuildInputs = [ k3sPlugins k3sBuildStage1 runc ]; propagatedBuildInputs = [ k3sPlugins k3sBuildStage1 runc ];
@ -186,6 +191,9 @@ let
else if stdenv.hostPlatform.system == "aarch64-linux" then "-arm64" else if stdenv.hostPlatform.system == "aarch64-linux" then "-arm64"
else throw "k3s isn't being built for ${stdenv.hostPlatform.system} yet."; else throw "k3s isn't being built for ${stdenv.hostPlatform.system} yet.";
DRONE_TAG = "v${version}";
DRONE_COMMIT = k3sCommit;
# In order to build the thick k3s binary (which is what # In order to build the thick k3s binary (which is what
# ./scripts/package-cli does), we need to get all the binaries that script # ./scripts/package-cli does), we need to get all the binaries that script
# expects in place. # expects in place.