k3s: fix go version patch
Previously we attempted to ignore Kubernetes upstream build recommendations by reverting the commit in K3S that started trying to enforce them. This commit is no longer cleanly revertable. Now we bypass the detection by overwriting the variable (`version.UpstreamGolang`) with the version we want to use instead (from the `go` input). This allows the package to be cleanly updated again.
This commit is contained in:
@@ -30,7 +30,6 @@ lib:
|
||||
# It is likely we will have to split out additional builders for additional
|
||||
# versions in the future, or customize this one further.
|
||||
{ lib
|
||||
, fetchpatch
|
||||
, makeWrapper
|
||||
, socat
|
||||
, iptables
|
||||
@@ -56,6 +55,7 @@ lib:
|
||||
, sqlite
|
||||
, nixosTests
|
||||
, pkgsBuildBuild
|
||||
, go
|
||||
}:
|
||||
|
||||
# k3s is a kinda weird derivation. One of the main points of k3s is the
|
||||
@@ -93,8 +93,9 @@ let
|
||||
|
||||
# https://github.com/k3s-io/k3s/blob/5fb370e53e0014dc96183b8ecb2c25a61e891e76/scripts/build#L19-L40
|
||||
versionldflags = [
|
||||
"-X github.com/rancher/k3s/pkg/version.Version=v${k3sVersion}"
|
||||
"-X github.com/rancher/k3s/pkg/version.GitCommit=${lib.substring 0 8 k3sCommit}"
|
||||
"-X github.com/k3s-io/k3s/pkg/version.Version=v${k3sVersion}"
|
||||
"-X github.com/k3s-io/k3s/pkg/version.GitCommit=${lib.substring 0 8 k3sCommit}"
|
||||
"-X github.com/k3s-io/k3s/pkg/version.UpstreamGolang=go${go.version}"
|
||||
"-X k8s.io/client-go/pkg/version.gitVersion=v${k3sVersion}"
|
||||
"-X k8s.io/client-go/pkg/version.gitCommit=${k3sCommit}"
|
||||
"-X k8s.io/client-go/pkg/version.gitTreeState=clean"
|
||||
@@ -185,15 +186,6 @@ let
|
||||
src = k3sRepo;
|
||||
vendorHash = k3sVendorHash;
|
||||
|
||||
patches =
|
||||
# Disable: Add runtime checking of golang version
|
||||
(fetchpatch {
|
||||
# https://github.com/k3s-io/k3s/pull/9054
|
||||
url = "https://github.com/k3s-io/k3s/commit/b297996b9252b02e56e9425f55f6becbf6bb7832.patch";
|
||||
hash = "sha256-xBOY2jnLhT9dtVKtq26V9QUnuX1q6E/9UcO9IaU719U=";
|
||||
revert = true;
|
||||
});
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ libseccomp sqlite.dev ];
|
||||
|
||||
|
||||
@@ -32216,6 +32216,7 @@ with pkgs;
|
||||
|
||||
inherit (callPackage ../applications/networking/cluster/k3s {
|
||||
buildGoModule = buildGo121Module;
|
||||
go = go_1_21;
|
||||
}) k3s_1_26 k3s_1_27 k3s_1_28 k3s_1_29;
|
||||
k3s = k3s_1_29;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user