1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-20 04:31:52 +00:00

Merge pull request #174794 from maxeaubrey/kind_0.14.0

kind: 0.11.1 -> 0.14.0
This commit is contained in:
maxine [they] 2022-05-27 12:32:52 +02:00 committed by GitHub
commit 7758705cfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 18 deletions

View file

@ -4,13 +4,13 @@ with lib;
buildGoModule rec {
pname = "kind";
version = "0.11.1";
version = "0.14.0";
src = fetchFromGitHub {
rev = "v${version}";
owner = "kubernetes-sigs";
repo = "kind";
sha256 = "sha256-pjg52ONseKNw06EOBzD6Elge+Cz+C3llPvjJPHkn1cw=";
sha256 = "sha256-yCzznSVWuVEkaoj9bo0WOp3Dvl3t1UJ/DwtXv5dp+dQ=";
};
patches = [
@ -18,7 +18,11 @@ buildGoModule rec {
./kernel-module-path.patch
];
vendorSha256 = "sha256-HiVdekSZrC/RkMSvcwm1mv6AE4bA5kayUsMdVCbckiE=";
vendorSha256 = "sha256-/UDmTyngydoso9F/iPp5JYlsfi0VNfHfTsxdGDaTK+w=";
CGO_ENABLED = 0;
GOFLAGS = [ "-trimpath" ];
ldFlags = [ "-buildid=" "-w" ];
doCheck = false;

View file

@ -1,6 +1,6 @@
diff --git a/pkg/cluster/internal/providers/common/getmodules.go b/pkg/cluster/internal/providers/common/getmodules.go
new file mode 100644
index 00000000..f42a883d
index 00000000..1cce5675
--- /dev/null
+++ b/pkg/cluster/internal/providers/common/getmodules.go
@@ -0,0 +1,15 @@
@ -9,39 +9,39 @@ index 00000000..f42a883d
+import "os"
+
+const (
+ fhsKernalModulePath = "/lib/modules"
+ nixKernalModulePath = "/run/booted-system/kernel-modules/lib"
+ fhsKernelModulePath = "/lib/modules"
+ nixKernelModulePath = "/run/booted-system/kernel-modules/lib/modules"
+)
+
+func GetKernelModulePath() string {
+ if _, err := os.Stat(nixKernalModulePath); !os.IsNotExist(err) {
+ return nixKernalModulePath
+ if _, err := os.Stat(nixKernelModulePath); !os.IsNotExist(err) {
+ return nixKernelModulePath
+ }
+ return fhsKernalModulePath
+ return fhsKernelModulePath
+}
diff --git a/pkg/cluster/internal/providers/docker/provision.go b/pkg/cluster/internal/providers/docker/provision.go
index 50161861..86d5b7b6 100644
index 97b05594..3aaa9830 100644
--- a/pkg/cluster/internal/providers/docker/provision.go
+++ b/pkg/cluster/internal/providers/docker/provision.go
@@ -242,7 +242,7 @@ func runArgsForNode(node *config.Node, clusterIPFamily config.ClusterIPFamily, n
@@ -225,7 +225,7 @@ func runArgsForNode(node *config.Node, clusterIPFamily config.ClusterIPFamily, n
// (please don't depend on doing this though!)
"--volume", "/var",
// some k8s things want to read /lib/modules
- "--volume", "/lib/modules:/lib/modules:ro",
+ "--volume", fmt.Sprintf("%s:/lib/modules:ro", common.GetKernelModulePath()),
// propagate KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER to the entrypoint script
"-e", "KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER",
},
args...,
)
diff --git a/pkg/cluster/internal/providers/podman/provision.go b/pkg/cluster/internal/providers/podman/provision.go
index 51dce486..3bc36b42 100644
index 50aa7018..7e25a4de 100644
--- a/pkg/cluster/internal/providers/podman/provision.go
+++ b/pkg/cluster/internal/providers/podman/provision.go
@@ -205,7 +205,7 @@ func runArgsForNode(node *config.Node, clusterIPFamily config.ClusterIPFamily, n
@@ -189,7 +189,7 @@ func runArgsForNode(node *config.Node, clusterIPFamily config.ClusterIPFamily, n
// dev: devices on the volume will be able to be used by processes within the container
"--volume", fmt.Sprintf("%s:/var:suid,exec,dev", varVolume),
// some k8s things want to read /lib/modules
- "--volume", "/lib/modules:/lib/modules:ro",
+ "--volume", fmt.Sprintf("%s:/lib/modules:ro", common.GetKernelModulePath()),
// propagate KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER to the entrypoint script
"-e", "KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER",
},
args...,
)

View file

@ -15736,7 +15736,7 @@ with pkgs;
kcov = callPackage ../development/tools/analysis/kcov { };
kind = callPackage ../development/tools/kind { };
kind = callPackage ../development/tools/kind { buildGoModule = buildGo118Module; };
khronos-ocl-icd-loader = callPackage ../development/libraries/khronos-ocl-icd-loader { };