Skip to content

Commit

Permalink
Add kube-score to available tools
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Gee <richard@technologee.co.uk>
  • Loading branch information
rgee0 authored and alexellis committed May 14, 2024
1 parent d3bdc46 commit 43a085f
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ There are 56 apps that you can install on your cluster.
| [kube-bench](https://github.com/aquasecurity/kube-bench) | Checks whether Kubernetes is deployed securely by running the checks documented in the CIS Kubernetes Benchmark. |
| [kube-burner](https://github.com/cloud-bulldozer/kube-burner) | A tool aimed at stressing Kubernetes clusters by creating or deleting a high quantity of objects. |
| [kube-linter](https://github.com/stackrox/kube-linter) | KubeLinter is a static analysis tool that checks Kubernetes YAML files and Helm charts to ensure the applications represented in them adhere to best practices. |
| [kube-score](https://github.com/zegl/kube-score) | A tool that performs static code analysis of your Kubernetes object definitions. |
| [kubebuilder](https://github.com/kubernetes-sigs/kubebuilder) | Framework for building Kubernetes APIs using custom resource definitions (CRDs). |
| [kubecm](https://github.com/sunny0826/kubecm) | Easier management of kubeconfig. |
| [kubeconform](https://github.com/yannh/kubeconform) | A FAST Kubernetes manifests validator, with support for Custom Resources |
Expand Down Expand Up @@ -912,6 +913,6 @@ There are 56 apps that you can install on your cluster.
| [waypoint](https://github.com/hashicorp/waypoint) | Easy application deployment for Kubernetes and Amazon ECS |
| [yq](https://github.com/mikefarah/yq) | Portable command-line YAML processor. |
| [yt-dlp](https://github.com/yt-dlp/yt-dlp) | Fork of youtube-dl with additional features and fixes |
There are 152 tools, use `arkade get NAME` to download one.
There are 153 tools, use `arkade get NAME` to download one.

> Note to contributors, run `arkade get --format markdown` to generate this list
59 changes: 59 additions & 0 deletions pkg/get/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7400,3 +7400,62 @@ func Test_DownloadFaasd(t *testing.T) {
}
}
}

func Test_DownloadKubeScore(t *testing.T) {
tools := MakeTools()
name := "kube-score"

tool := getTool(name, tools)

const toolVersion = "v1.18.0"

tests := []test{
{
os: "linux",
arch: arch64bit,
version: toolVersion,
url: "https://github.com/zegl/kube-score/releases/download/v1.18.0/kube-score_1.18.0_linux_amd64.tar.gz",
},
{
os: "darwin",
arch: arch64bit,
version: toolVersion,
url: "https://github.com/zegl/kube-score/releases/download/v1.18.0/kube-score_1.18.0_darwin_amd64.tar.gz",
},
{
os: "linux",
arch: archARM64,
version: toolVersion,
url: "https://github.com/zegl/kube-score/releases/download/v1.18.0/kube-score_1.18.0_linux_arm64.tar.gz",
},
{
os: "darwin",
arch: archDarwinARM64,
version: toolVersion,
url: "https://github.com/zegl/kube-score/releases/download/v1.18.0/kube-score_1.18.0_darwin_arm64.tar.gz",
},
{
os: "ming",
arch: archARM64,
version: toolVersion,
url: "https://github.com/zegl/kube-score/releases/download/v1.18.0/kube-score_1.18.0_windows_arm64.exe",
},
{
os: "ming",
arch: arch64bit,
version: toolVersion,
url: "https://github.com/zegl/kube-score/releases/download/v1.18.0/kube-score_1.18.0_windows_amd64.exe",
},
}

for _, tc := range tests {
got, err := tool.GetURL(tc.os, tc.arch, tc.version, false)
if err != nil {
t.Fatal(err)
}
if got != tc.url {
t.Errorf("\nwant: %s, \n got: %s", tc.url, got)
}
}

}
25 changes: 25 additions & 0 deletions pkg/get/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -4168,5 +4168,30 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Repo}}
`,
})

tools = append(tools,
Tool{
Owner: "zegl",
Repo: "kube-score",
Name: "kube-score",
Description: "A tool that performs static code analysis of your Kubernetes object definitions.",
BinaryTemplate: `
{{$os := .OS}}
{{$arch := .Arch}}
{{$ext := "tar.gz"}}
{{- if HasPrefix .OS "ming" -}}
{{ $os = "windows" }}
{{ $ext = "exe" }}
{{- end -}}
{{- if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
{{$arch = "arm64"}}
{{- else if eq .Arch "x86_64" -}}
{{ $arch = "amd64" }}
{{- end -}}
{{.Name}}_{{.VersionNumber}}_{{$os}}_{{$arch}}.{{$ext}}`,
})

return tools
}

0 comments on commit 43a085f

Please sign in to comment.