diff --git a/pkgs/applications/networking/cluster/helm/plugins/default.nix b/pkgs/applications/networking/cluster/helm/plugins/default.nix index 16fceff4ee1a..1a6aa12a91e5 100644 --- a/pkgs/applications/networking/cluster/helm/plugins/default.nix +++ b/pkgs/applications/networking/cluster/helm/plugins/default.nix @@ -12,4 +12,6 @@ helm-secrets = callPackage ./helm-secrets.nix { }; + helm-unittest = callPackage ./helm-unittest.nix { }; + } diff --git a/pkgs/applications/networking/cluster/helm/plugins/helm-unittest.nix b/pkgs/applications/networking/cluster/helm/plugins/helm-unittest.nix new file mode 100644 index 000000000000..9b88d99e44ac --- /dev/null +++ b/pkgs/applications/networking/cluster/helm/plugins/helm-unittest.nix @@ -0,0 +1,34 @@ +{ buildGoModule, fetchFromGitHub, lib }: + +buildGoModule rec { + pname = "helm-unittest"; + version = "0.3.3"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "v${version}"; + hash = "sha256-11rgARUfTbr8FkmR2lI4uoIqzi9cRuVPalUOsxsnO3E="; + }; + + vendorHash = "sha256-E9HSP8c/rGG+PLbnT8V5GflpnFItCeXyeLGiqDj4tRI="; + + # NOTE: Remove the install and upgrade hooks. + postPatch = '' + sed -i '/^hooks:/,+2 d' plugin.yaml + ''; + + postInstall = '' + install -dm755 $out/${pname} + mv $out/bin/helm-unittest $out/${pname}/untt + rmdir $out/bin + install -m644 -Dt $out/${pname} plugin.yaml + ''; + + meta = with lib; { + description = "BDD styled unit test framework for Kubernetes Helm charts as a Helm plugin"; + homepage = "https://github.com/helm-unittest/helm-unittest"; + license = licenses.mit; + maintainers = with maintainers; [ yurrriq ]; + }; +}