nixpkgs/pkgs/by-name/ku/kubeshark/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.9 KiB
Nix
Raw Normal View History

2023-02-09 09:55:52 +00:00
{ stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, kubeshark, nix-update-script }:
buildGoModule rec {
pname = "kubeshark";
2024-11-13 18:44:40 +00:00
version = "52.3.89";
2023-02-09 09:55:52 +00:00
src = fetchFromGitHub {
owner = "kubeshark";
repo = "kubeshark";
rev = "v${version}";
2024-11-13 18:44:40 +00:00
hash = "sha256-v5XxvY3omO9h1xtm+VSVP/zrU8uRJXvwSdxScAujWOU=";
2023-02-09 09:55:52 +00:00
};
2024-11-13 18:44:40 +00:00
vendorHash = "sha256-kzyQW4bVE7oMOlHVG7LKG1AMTRYa5GLiiEhdarIhMSo=";
2023-02-09 09:55:52 +00:00
ldflags = let t = "github.com/kubeshark/kubeshark"; in [
"-s" "-w"
"-X ${t}/misc.GitCommitHash=${src.rev}"
"-X ${t}/misc.Branch=master"
"-X ${t}/misc.BuildTimestamp=0"
"-X ${t}/misc.Platform=unknown"
"-X ${t}/misc.Ver=${version}"
];
nativeBuildInputs = [ installShellFiles ];
checkPhase = ''
go test ./...
'';
doCheck = true;
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
2023-02-09 09:55:52 +00:00
installShellCompletion --cmd kubeshark \
--bash <($out/bin/kubeshark completion bash) \
--fish <($out/bin/kubeshark completion fish) \
--zsh <($out/bin/kubeshark completion zsh)
'';
passthru = {
tests.version = testers.testVersion {
package = kubeshark;
command = "kubeshark version";
inherit version;
};
updateScript = nix-update-script { };
};
meta = with lib; {
changelog = "https://github.com/kubeshark/kubeshark/releases/tag/${version}";
description = "API Traffic Viewer for Kubernetes";
mainProgram = "kubeshark";
2023-02-09 09:55:52 +00:00
homepage = "https://kubeshark.co/";
license = licenses.asl20;
longDescription = ''
The API traffic viewer for Kubernetes providing real-time, protocol-aware visibility into Kubernetes internal network,
Think TCPDump and Wireshark re-invented for Kubernetes
capturing, dissecting and monitoring all traffic and payloads going in, out and across containers, pods, nodes and clusters.
'';
2023-05-11 12:57:16 +00:00
maintainers = with maintainers; [ bryanasdev000 qjoly ];
2023-02-09 09:55:52 +00:00
};
}