44 lines
1.2 KiB
Nix
44 lines
1.2 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, kubectl-gadget, testers }:
|
|
|
|
buildGoModule rec {
|
|
pname = "kubectl-gadget";
|
|
version = "0.33.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "inspektor-gadget";
|
|
repo = "inspektor-gadget";
|
|
rev = "v${version}";
|
|
hash = "sha256-bPpjaJcMX9kv+9p6trHKXJ2kj78zhGYdHnXnfYW3WcY=";
|
|
};
|
|
|
|
vendorHash = "sha256-kYMckPdnS3rkuzRPEflRholHW2zfXyDomTb93J5z0aI=";
|
|
|
|
CGO_ENABLED = 0;
|
|
|
|
ldflags = [
|
|
"-s" "-w"
|
|
"-X github.com/inspektor-gadget/inspektor-gadget/internal/version.version=v${version}"
|
|
"-X main.gadgetimage=ghcr.io/inspektor-gadget/inspektor-gadget:v${version}"
|
|
"-extldflags=-static"
|
|
];
|
|
|
|
tags = [
|
|
"withoutebpf"
|
|
];
|
|
|
|
subPackages = [ "cmd/kubectl-gadget" ];
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
package = kubectl-gadget;
|
|
command = "kubectl-gadget version || true"; # mask non-zero return code if no kubeconfig present
|
|
version = "v${version}";
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Collection of gadgets for troubleshooting Kubernetes applications using eBPF";
|
|
mainProgram = "kubectl-gadget";
|
|
homepage = "https://inspektor-gadget.io";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ kranurag7 devusb ];
|
|
};
|
|
}
|