Merge pull request #168282 from 06kellyjac/kubescape

kubescape: 2.0.150 -> 2.0.152
This commit is contained in:
Fabian Affolter 2022-04-11 21:34:36 +02:00 committed by GitHub
commit 7c75e868ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,31 +6,38 @@
buildGoModule rec { buildGoModule rec {
pname = "kubescape"; pname = "kubescape";
version = "2.0.150"; version = "2.0.152";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "armosec"; owner = "armosec";
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
hash = "sha256-1D/ixtZI7/H05MD6zRtZCF8yhW1FhvRpdPWieAPwxHs="; hash = "sha256-hibXmA2JerfnkGiSnBUCMHGPm4Tefnsl/x2VAS5z0Fo=";
}; };
vendorSha256 = "sha256-HfsQfoz1n3FEd2eVBBz3Za2jYCSrozXpL34Z8CgQsTA=";
nativeBuildInputs = [ nativeBuildInputs = [
installShellFiles installShellFiles
]; ];
modRoot = "cmd";
vendorSha256 = "sha256-Nznf793OMQ7ZCWb5voVcLyMiBa1Z8Dswp7Tdn1AzlJA=";
ldflags = [ ldflags = [
"-s" "-s"
"-w" "-w"
"-X github.com/armosec/kubescape/core/cautils.BuildNumber=v${version}" "-X github.com/armosec/kubescape/v2/core/cautils.BuildNumber=v${version}"
]; ];
postBuild = '' subPackages = [ "." ];
# kubescape/cmd should be called kubescape
mv $GOPATH/bin/{cmd,kubescape} 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 = '' postInstall = ''
@ -44,6 +51,8 @@ buildGoModule rec {
installCheckPhase = '' installCheckPhase = ''
runHook preInstallCheck runHook preInstallCheck
$out/bin/kubescape --help $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}" $out/bin/kubescape --version | grep "v${version}"
runHook postInstallCheck runHook postInstallCheck
''; '';