diff --git a/README.md b/README.md index 6d2b7df94..1ada37933 100644 --- a/README.md +++ b/README.md @@ -665,6 +665,7 @@ There are 56 apps that you can install on your cluster. | promtool | Prometheus rule tester and debugging utility | | rekor-cli | Secure Supply Chain - Transparency Log | | rpk | Kafka compatible streaming platform for mission critical workloads. | +| run-job | Run a Kubernetes Job and get the logs when it's done. | | sops | Simple and flexible tool for managing secrets | | stern | Multi pod and container log tailing for Kubernetes. | | talosctl | The command-line tool for managing Talos Linux OS. | @@ -681,6 +682,6 @@ There are 56 apps that you can install on your cluster. | waypoint | Easy application deployment for Kubernetes and Amazon ECS | | yq | Portable command-line YAML processor. | -There are 103 tools, use `arkade get NAME` to download one. +There are 104 tools, use `arkade get NAME` to download one. > Note to contributors, run `arkade get --output markdown` to generate this list diff --git a/pkg/get/get_test.go b/pkg/get/get_test.go index 340572de7..457594190 100644 --- a/pkg/get/get_test.go +++ b/pkg/get/get_test.go @@ -305,6 +305,59 @@ func Test_DownloadArkade(t *testing.T) { } } +func Test_DownloadRunJob(t *testing.T) { + tools := MakeTools() + name := "run-job" + + var tool *Tool + for _, target := range tools { + if name == target.Name { + tool = &target + break + } + } + + tests := []test{ + {os: "mingw64_nt-10.0-18362", + arch: arch64bit, + version: "0.0.1", + url: "https://github.com/alexellis/run-job/releases/download/0.0.1/run-job.exe"}, + {os: "darwin", + arch: arch64bit, + version: "0.0.1", + url: "https://github.com/alexellis/run-job/releases/download/0.0.1/run-job-darwin"}, + {os: "darwin", + arch: archDarwinARM64, + version: "0.0.1", + url: "https://github.com/alexellis/run-job/releases/download/0.0.1/run-job-darwin-arm64"}, + {os: "linux", + arch: arch64bit, + version: "0.0.1", + url: "https://github.com/alexellis/run-job/releases/download/0.0.1/run-job"}, + {os: "linux", + arch: "armv6l", + version: "0.0.1", + url: "https://github.com/alexellis/run-job/releases/download/0.0.1/run-job-armhf"}, + {os: "linux", + arch: "armv7l", + version: "0.0.1", + url: "https://github.com/alexellis/run-job/releases/download/0.0.1/run-job-armhf"}, + {os: "linux", + arch: archARM64, + version: "0.0.1", + url: "https://github.com/alexellis/run-job/releases/download/0.0.1/run-job-arm64"}, + } + 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.Fatalf("want: %s, got: %s", tc.url, got) + } + } +} + func Test_DownloadKubectl(t *testing.T) { tools := MakeTools() name := "kubectl" diff --git a/pkg/get/tools.go b/pkg/get/tools.go index fda331d6f..6c05e5b92 100644 --- a/pkg/get/tools.go +++ b/pkg/get/tools.go @@ -351,6 +351,31 @@ https://storage.googleapis.com/kubernetes-release/release/{{.Version}}/bin/{{$os {{- end -}}`, }) + tools = append(tools, + Tool{ + Owner: "alexellis", + Repo: "run-job", + Name: "run-job", + Description: "Run a Kubernetes Job and get the logs when it's done.", + BinaryTemplate: `{{ if HasPrefix .OS "ming" -}} + {{.Name}}.exe + {{- else if eq .OS "darwin" -}} + {{ if eq .Arch "arm64" -}} + {{.Name}}-darwin-arm64 + {{- else -}} + {{.Name}}-darwin + {{- end -}} + {{- else if eq .Arch "armv6l" -}} + {{.Name}}-armhf + {{- else if eq .Arch "armv7l" -}} + {{.Name}}-armhf + {{- else if eq .Arch "aarch64" -}} + {{.Name}}-arm64 + {{- else -}} + {{.Name}} + {{- end -}}`, + }) + tools = append(tools, Tool{ Owner: "bitnami-labs",