kubescape 2.0.147 (new formula)

* kubescape 2.0.147 (new formula)
* kubescape: fix fish completion
* kubescape: use commit hash rather than branch name for test file

Closes #95034.

Signed-off-by: Rui Chen <rui@chenrui.dev>
Co-authored-by: Branch Vincent <branchevincent@gmail.com>
Co-authored-by: rui <rui@chenrui.dev>
Signed-off-by: Branch Vincent <19800529+branchvincent@users.noreply.github.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
master
Rui Chen 2022-02-12 18:51:15 -05:00 committed by BrewTestBot
parent 535ad18652
commit dc96c2c319
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
1 changed files with 32 additions and 0 deletions

32
Formula/kubescape.rb Normal file
View File

@ -0,0 +1,32 @@
class Kubescape < Formula
desc "Kubernetes testing according to Hardening Guidance by NSA and CISA"
homepage "https://github.com/armosec/kubescape"
url "https://github.com/armosec/kubescape/archive/v2.0.147.tar.gz"
sha256 "d886e868cacc0554f7e80ce3885487756450d3f1d4079cd0377bda709772a3c4"
license "Apache-2.0"
head "https://github.com/armosec/kubescape.git", branch: "master"
depends_on "go" => :build
def install
ldflags = %W[
-s -w
-X github.com/armosec/kubescape/cautils.BuildNumber=#{version}
]
system "go", "build", *std_go_args(ldflags: ldflags)
output = Utils.safe_popen_read(bin/"kubescape", "completion", "bash")
(bash_completion/"kubescape").write output
output = Utils.safe_popen_read(bin/"kubescape", "completion", "zsh")
(zsh_completion/"_kubescape").write output
output = Utils.safe_popen_read(bin/"kubescape", "completion", "fish")
(fish_completion/"kubescape.fish").write output
end
test do
manifest = "https://raw.githubusercontent.com/GoogleCloudPlatform/microservices-demo/b8fe8900ca1da10c85c9a203d9832b2ee33cc85f/release/kubernetes-manifests.yaml"
assert_match "FAILED RESOURCES", shell_output("#{bin}/kubescape scan framework nsa #{manifest}")
assert_match version.to_s, shell_output("#{bin}/kubescape version")
end
end