mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 21:53:32 +00:00
61 lines
1.9 KiB
Nix
61 lines
1.9 KiB
Nix
{ stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, kubeshark, nix-update-script }:
|
||
|
||
buildGoModule rec {
|
||
pname = "kubeshark";
|
||
version = "39.4";
|
||
|
||
src = fetchFromGitHub {
|
||
owner = "kubeshark";
|
||
repo = "kubeshark";
|
||
rev = version;
|
||
sha256 = "sha256-Z32FuQPh9wG2XNMAfC9Zg7G9j8btNxTcYRl+Z5f5gM8=";
|
||
};
|
||
|
||
vendorHash = "sha256-stpWIqLQ2PTjocuekkOI/D7QvkxX4NI1YTKIh3V6c4c=";
|
||
|
||
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.hostPlatform == stdenv.buildPlatform) ''
|
||
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 = "The API Traffic Viewer for Kubernetes";
|
||
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.
|
||
'';
|
||
maintainers = with maintainers; [ bryanasdev000 ];
|
||
};
|
||
}
|