diff --git a/README.md b/README.md index 0c594040e..c7b0e9633 100644 --- a/README.md +++ b/README.md @@ -885,6 +885,7 @@ There are 52 apps that you can install on your cluster. | [regctl](https://github.com/regclient/regclient) | Utility for accessing docker registries | | [rekor-cli](https://github.com/sigstore/rekor) | Secure Supply Chain - Transparency Log | | [replicated](https://github.com/replicatedhq/replicated) | CLI for interacting with the Replicated Vendor API | +| [rosa](https://github.com/openshift/rosa) | Red Hat OpenShift on AWS (ROSA) command line tool | | [rpk](https://github.com/redpanda-data/redpanda) | Kafka compatible streaming platform for mission critical workloads. | | [run-job](https://github.com/alexellis/run-job) | Run a Kubernetes Job and get the logs when it's done. | | [scaleway-cli](https://github.com/scaleway/scaleway-cli) | Scaleway CLI is a tool to help you pilot your Scaleway infrastructure directly from your terminal. | @@ -917,6 +918,6 @@ There are 52 apps that you can install on your cluster. | [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 158 tools, use `arkade get NAME` to download one. +There are 159 tools, use `arkade get NAME` to download one. > Note to contributors, run `go build && ./arkade get --format markdown` to generate this list \ No newline at end of file diff --git a/pkg/get/get_test.go b/pkg/get/get_test.go index ddccee391..d86a7bbfe 100644 --- a/pkg/get/get_test.go +++ b/pkg/get/get_test.go @@ -8020,3 +8020,59 @@ func Test_Crossplane(t *testing.T) { } } + +func Test_Download_rosa(t *testing.T) { + tools := MakeTools() + name := "rosa" + const toolVersion = "v1.2.46" + + tool := getTool(name, tools) + + tests := []test{ + { + os: "darwin", + arch: arch64bit, + version: toolVersion, + url: "https://github.com/openshift/rosa/releases/download/v1.2.46/rosa_Darwin_x86_64.tar.gz", + }, + { + os: "darwin", + arch: archDarwinARM64, + version: toolVersion, + url: "https://github.com/openshift/rosa/releases/download/v1.2.46/rosa_Darwin_arm64.tar.gz", + }, + { + os: "linux", + arch: arch64bit, + version: toolVersion, + url: "https://github.com/openshift/rosa/releases/download/v1.2.46/rosa_Linux_x86_64.tar.gz", + }, + { + os: "linux", + arch: archARM64, + version: toolVersion, + url: "https://github.com/openshift/rosa/releases/download/v1.2.46/rosa_Linux_arm64.tar.gz", + }, + { + os: "mingw64_nt-10.0-18362", + arch: arch64bit, + version: toolVersion, + url: "https://github.com/openshift/rosa/releases/download/v1.2.46/rosa_Windows_x86_64.zip", + }, + { + os: "mingw64_nt-10.0-18362", + arch: archARM64, + version: toolVersion, + url: "https://github.com/openshift/rosa/releases/download/v1.2.46/rosa_Windows_arm64.zip", + }, + } + 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("\nwant: %s\ngot: %s", tc.url, got) + } + } +} diff --git a/pkg/get/tools.go b/pkg/get/tools.go index 0cb22a857..ce255c10a 100644 --- a/pkg/get/tools.go +++ b/pkg/get/tools.go @@ -4353,5 +4353,34 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}} https://releases.crossplane.io/stable/{{.Version}}/bin/{{$os}}_{{$arch}}/crank{{$ext}}`, }) + + tools = append(tools, + Tool{ + Owner: "openshift", + Repo: "rosa", + Name: "rosa", + VersionStrategy: GitHubVersionStrategy, + Description: "Red Hat OpenShift on AWS (ROSA) command line tool", + BinaryTemplate: ` + {{$os := .OS}} + {{$arch := .Arch}} + {{$ext := "tar.gz"}} + + {{- if eq .OS "darwin" -}} + {{$os = "Darwin"}} + {{- else if eq .OS "linux" -}} + {{$os = "Linux"}} + {{- else if HasPrefix .OS "ming" -}} + {{$os = "Windows"}} + {{$ext = "zip"}} + {{- end -}} + + {{- if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}} + {{$arch = "arm64"}} + {{- end -}} + + rosa_{{$os}}_{{$arch}}.{{$ext}} + `, + }) return tools }