Merge pull request #228581 from dtzitzon/dtz/k3s
This commit is contained in:
commit
91bd44ef44
|
@ -62,20 +62,20 @@ import ../make-test-python.nix ({ pkgs, lib, k3s, ... }:
|
||||||
start_all()
|
start_all()
|
||||||
|
|
||||||
machine.wait_for_unit("k3s")
|
machine.wait_for_unit("k3s")
|
||||||
machine.succeed("k3s kubectl cluster-info")
|
machine.succeed("kubectl cluster-info")
|
||||||
machine.fail("sudo -u noprivs k3s kubectl cluster-info")
|
machine.fail("sudo -u noprivs kubectl cluster-info")
|
||||||
'' # Fix-Me: Tests fail for 'aarch64-linux' as: "CONFIG_CGROUP_FREEZER: missing (fail)"
|
'' # Fix-Me: Tests fail for 'aarch64-linux' as: "CONFIG_CGROUP_FREEZER: missing (fail)"
|
||||||
+ lib.optionalString (!pkgs.stdenv.isAarch64) ''machine.succeed("k3s check-config")'' + ''
|
+ lib.optionalString (!pkgs.stdenv.isAarch64) ''machine.succeed("k3s check-config")'' + ''
|
||||||
|
|
||||||
machine.succeed(
|
machine.succeed(
|
||||||
"${pauseImage} | k3s ctr image import -"
|
"${pauseImage} | ctr image import -"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Also wait for our service account to show up; it takes a sec
|
# Also wait for our service account to show up; it takes a sec
|
||||||
machine.wait_until_succeeds("k3s kubectl get serviceaccount default")
|
machine.wait_until_succeeds("kubectl get serviceaccount default")
|
||||||
machine.succeed("k3s kubectl apply -f ${testPodYaml}")
|
machine.succeed("kubectl apply -f ${testPodYaml}")
|
||||||
machine.succeed("k3s kubectl wait --for 'condition=Ready' pod/test")
|
machine.succeed("kubectl wait --for 'condition=Ready' pod/test")
|
||||||
machine.succeed("k3s kubectl delete -f ${testPodYaml}")
|
machine.succeed("kubectl delete -f ${testPodYaml}")
|
||||||
|
|
||||||
# regression test for #176445
|
# regression test for #176445
|
||||||
machine.fail("journalctl -o cat -u k3s.service | grep 'ipset utility not found'")
|
machine.fail("journalctl -o cat -u k3s.service | grep 'ipset utility not found'")
|
||||||
|
|
|
@ -313,6 +313,9 @@ buildGoModule rec {
|
||||||
wrapProgram $out/bin/k3s \
|
wrapProgram $out/bin/k3s \
|
||||||
--prefix PATH : ${lib.makeBinPath k3sRuntimeDeps} \
|
--prefix PATH : ${lib.makeBinPath k3sRuntimeDeps} \
|
||||||
--prefix PATH : "$out/bin"
|
--prefix PATH : "$out/bin"
|
||||||
|
ln -s $out/bin/k3s $out/bin/kubectl
|
||||||
|
ln -s $out/bin/k3s $out/bin/crictl
|
||||||
|
ln -s $out/bin/k3s $out/bin/ctr
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doInstallCheck = true;
|
doInstallCheck = true;
|
||||||
|
|
|
@ -317,6 +317,9 @@ buildGoModule rec {
|
||||||
wrapProgram $out/bin/k3s \
|
wrapProgram $out/bin/k3s \
|
||||||
--prefix PATH : ${lib.makeBinPath k3sRuntimeDeps} \
|
--prefix PATH : ${lib.makeBinPath k3sRuntimeDeps} \
|
||||||
--prefix PATH : "$out/bin"
|
--prefix PATH : "$out/bin"
|
||||||
|
ln -s $out/bin/k3s $out/bin/kubectl
|
||||||
|
ln -s $out/bin/k3s $out/bin/crictl
|
||||||
|
ln -s $out/bin/k3s $out/bin/ctr
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doInstallCheck = true;
|
doInstallCheck = true;
|
||||||
|
|
|
@ -84,6 +84,10 @@ let
|
||||||
homepage = "https://k3s.io";
|
homepage = "https://k3s.io";
|
||||||
maintainers = with maintainers; [ euank mic92 yajo ];
|
maintainers = with maintainers; [ euank mic92 yajo ];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
|
|
||||||
|
# resolves collisions with other installations of kubectl, crictl, ctr
|
||||||
|
# prefer non-k3s versions
|
||||||
|
priority = 5;
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://github.com/k3s-io/k3s/blob/5fb370e53e0014dc96183b8ecb2c25a61e891e76/scripts/build#L19-L40
|
# https://github.com/k3s-io/k3s/blob/5fb370e53e0014dc96183b8ecb2c25a61e891e76/scripts/build#L19-L40
|
||||||
|
@ -325,6 +329,9 @@ buildGoModule rec {
|
||||||
wrapProgram $out/bin/k3s \
|
wrapProgram $out/bin/k3s \
|
||||||
--prefix PATH : ${lib.makeBinPath k3sRuntimeDeps} \
|
--prefix PATH : ${lib.makeBinPath k3sRuntimeDeps} \
|
||||||
--prefix PATH : "$out/bin"
|
--prefix PATH : "$out/bin"
|
||||||
|
ln -s $out/bin/k3s $out/bin/kubectl
|
||||||
|
ln -s $out/bin/k3s $out/bin/crictl
|
||||||
|
ln -s $out/bin/k3s $out/bin/ctr
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doInstallCheck = true;
|
doInstallCheck = true;
|
||||||
|
|
Loading…
Reference in a new issue