-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
Resolves issue #951 by adding support for the Red Hat OpenShift on AWS (rosa) cli tool #966
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6350,6 +6350,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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you are missing a few tests here for different archs. e.g. https://github.com/alexellis/arkade/blob/master/pkg/get/get_test.go#L6467 |
||
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" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3669,6 +3669,41 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Repo}} | |
`, | ||
}) | ||
|
||
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 -}} | ||
Comment on lines
+3691
to
+3697
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. arch is not being used in the template, why do we need it? |
||
|
||
{{- if eq .VersionNumber "" -}} | ||
{{$version = "latest"}} | ||
{{- end -}} | ||
|
||
https://mirror.openshift.com/pub/openshift-v4/clients/rosa/{{$version}}/rosa-{{$os}}.{{$ext}} | ||
`, | ||
}) | ||
|
||
tools = append(tools, | ||
Tool{ | ||
Owner: "atuinsh", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Could you regenerate the table? There must be one more line with the changed numbers of tools.