Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- Added CLI tools for Red Hat OpenShift on AWS #955

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ There are 56 apps that you can install on your cluster.
| [promtool](https://github.com/prometheus/prometheus) | Prometheus rule tester and debugging utility |
| [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. |
Expand Down
40 changes: 40 additions & 0 deletions pkg/get/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6271,6 +6271,46 @@ func Test_DownloadOpenshiftCLI(t *testing.T) {
}
}

func Test_DownloadRosaCLI(t *testing.T) {
tools := MakeTools()
name := "rosa"

tool := getTool(name, tools)

const toolVersion = "1.2.23"

tests := []test{
{
os: "linux",
arch: arch64bit,
version: toolVersion,
url: `https://mirror.openshift.com/pub/openshift-v4/clients/rosa/1.2.23/rosa-linux.tar.gz`,
},
{
os: "darwin",
arch: arch64bit,
version: toolVersion,
url: `https://mirror.openshift.com/pub/openshift-v4/clients/rosa/1.2.23/rosa-macosx.tar.gz`,
},
{
os: "ming",
arch: arch64bit,
version: toolVersion,
url: `https://mirror.openshift.com/pub/openshift-v4/clients/rosa/1.2.23/rosa-windows.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.Errorf("want: %s, got: %s", tc.url, got)
}
}
}

func Test_DownloadAtuin(t *testing.T) {
tools := MakeTools()
name := "atuin"
Expand Down
35 changes: 35 additions & 0 deletions pkg/get/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -3643,6 +3643,41 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
`,
})

tools = append(tools,
Tool{
Owner: "redhat",
Repo: "rosa",
Name: "rosa",
Description: "Red Hat OpenShift on AWS (ROSA) command line tool",
URLTemplate: `
{{$os := .OS}}
{{$arch := .Arch}}
{{$ext := "tar.gz"}}
{{$version := .VersionNumber}}

{{- if eq .OS "darwin" -}}
{{$os = "macosx"}}
{{- else if HasPrefix .OS "ming" -}}
{{$os = "windows"}}
{{$ext = "zip"}}
{{- end -}}

{{- if eq .Arch "aarch64" -}}
{{$arch = "-arm64"}}
{{- else if eq .Arch "arm64" -}}
{{ $arch = "-arm64" }}
{{- else if eq .Arch "x86_64" -}}
{{ $arch = "" }}
{{- end -}}

{{- if eq .VersionNumber "" -}}
{{$version = "latest"}}
{{- end -}}

https://mirror.openshift.com/pub/openshift-v4/clients/rosa/{{$version}}/rosa-{{$os}}.{{$ext}}
`,
})

tools = append(tools,
Tool{
Owner: "ellie",
Expand Down
Loading