2021-09-18 10:52:07 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub }:
|
|
|
|
|
2021-09-22 15:38:15 +00:00
|
|
|
buildGoModule rec {
|
2021-09-18 10:52:07 +00:00
|
|
|
pname = "cni-plugin-flannel";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "1.2.0";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "flannel-io";
|
|
|
|
repo = "cni-plugin";
|
2021-09-22 15:38:15 +00:00
|
|
|
rev = "v${version}";
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-9AVXm3+VJFLQwe7EHwI8LmWKxfX1r0yjmKeaReQvxR4=";
|
2021-09-18 10:52:07 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
vendorHash = "sha256-DhvaXC/n4yiVDibB8kymzltNhEIxKdTsEDN9Sfc/wxU=";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s" "-w"
|
|
|
|
"-X main.Version=${version}"
|
|
|
|
"-X main.Commit=${version}"
|
|
|
|
"-X main.Program=flannel"
|
|
|
|
];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/cni-plugin $out/bin/flannel
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = false;
|
2021-12-06 16:07:01 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
2022-06-16 17:23:12 +00:00
|
|
|
$out/bin/flannel 2>&1 | fgrep -q $version
|
2021-12-06 16:07:01 +00:00
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "flannel CNI plugin";
|
|
|
|
homepage = "https://github.com/flannel-io/cni-plugin/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ abbe ];
|
|
|
|
};
|
|
|
|
}
|