about summary refs log tree commit diff
path: root/pkgs/tools/security/kubescape
diff options
context:
space:
mode:
author06kellyjac <dev@j-k.io>2022-04-11 15:58:37 +0100
committer06kellyjac <dev@j-k.io>2022-04-11 15:58:37 +0100
commitb6a852d51d310a9cb514631490b5d2ca139f6c9a (patch)
tree772288c89b0c8631a5b70f08a8475f984568802e /pkgs/tools/security/kubescape
parentce686f05056e971be5d81f5ee4f34c434e5b98d4 (diff)
kubescape: 2.0.150 -> 2.0.152
Diffstat (limited to 'pkgs/tools/security/kubescape')
-rw-r--r--pkgs/tools/security/kubescape/default.nix27
1 files changed, 18 insertions, 9 deletions
diff --git a/pkgs/tools/security/kubescape/default.nix b/pkgs/tools/security/kubescape/default.nix
index 377327e6571c9..23f52e3b52ed7 100644
--- a/pkgs/tools/security/kubescape/default.nix
+++ b/pkgs/tools/security/kubescape/default.nix
@@ -6,31 +6,38 @@
 
 buildGoModule rec {
   pname = "kubescape";
-  version = "2.0.150";
+  version = "2.0.152";
 
   src = fetchFromGitHub {
     owner = "armosec";
     repo = pname;
     rev = "v${version}";
-    hash = "sha256-1D/ixtZI7/H05MD6zRtZCF8yhW1FhvRpdPWieAPwxHs=";
+    hash = "sha256-hibXmA2JerfnkGiSnBUCMHGPm4Tefnsl/x2VAS5z0Fo=";
   };
+  vendorSha256 = "sha256-HfsQfoz1n3FEd2eVBBz3Za2jYCSrozXpL34Z8CgQsTA=";
 
   nativeBuildInputs = [
     installShellFiles
   ];
 
-  modRoot = "cmd";
-  vendorSha256 = "sha256-Nznf793OMQ7ZCWb5voVcLyMiBa1Z8Dswp7Tdn1AzlJA=";
-
   ldflags = [
     "-s"
     "-w"
-    "-X github.com/armosec/kubescape/core/cautils.BuildNumber=v${version}"
+    "-X github.com/armosec/kubescape/v2/core/cautils.BuildNumber=v${version}"
   ];
 
-  postBuild = ''
-    # kubescape/cmd should be called kubescape
-    mv $GOPATH/bin/{cmd,kubescape}
+  subPackages = [ "." ];
+
+  preCheck = ''
+    # Feed in all but the integration tests for testing
+    # This is because subPackages above limits what is built to just what we
+    # want but also limits the tests
+    # Skip httphandler tests - the checkPhase doesn't care about excludedPackages
+    getGoDirs() {
+      go list ./... | grep -v httphandler
+    }
+
+    rm core/pkg/resourcehandler/{repositoryscanner,urlloader}_test.go
   '';
 
   postInstall = ''
@@ -44,6 +51,8 @@ buildGoModule rec {
   installCheckPhase = ''
     runHook preInstallCheck
     $out/bin/kubescape --help
+    # `--version` vs `version` shows the version without checking for latest
+    # if the flag is missing the BuildNumber may have moved
     $out/bin/kubescape --version | grep "v${version}"
     runHook postInstallCheck
   '';