Skip to content

Commit

Permalink
Cause doctl to fail with 404 for armv7l
Browse files Browse the repository at this point in the history
There is currently no binary available for armv7l, therefore
the template should cause a 404 error to show the user this
feedback.

See also: #1078

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Jun 5, 2024
1 parent 4ff0cf1 commit 1ea9ef1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions pkg/get/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1082,19 +1082,24 @@ func Test_DownloadDigitalOcean(t *testing.T) {
{os: "mingw64_nt-10.0-18362",
arch: arch64bit,
version: toolVersion,
url: fmt.Sprintf(urlTemplate, "windows", "amd64", "zip")},
url: fmt.Sprintf(urlTemplate, "windows", "amd64", "zip"),
},
{os: "linux",
arch: arch64bit,
version: toolVersion,
url: fmt.Sprintf(urlTemplate, "linux", "amd64", "tar.gz")},
url: fmt.Sprintf(urlTemplate, "linux", "amd64", "tar.gz"),
},
{os: "darwin",
arch: arch64bit,
version: toolVersion,
url: fmt.Sprintf(urlTemplate, "darwin", "amd64", "tar.gz")},
url: fmt.Sprintf(urlTemplate, "darwin", "amd64", "tar.gz"),
},
{os: "linux",
arch: archARM7,
version: toolVersion,
url: fmt.Sprintf(urlTemplate, "linux", "arm64", "tar.gz")},
// designed to fail with 404 due to no binary being published
url: "https://github.com/digitalocean/doctl/releases/download/v1.46.0/doctl-1.46.0-linux-.tar.gz",
},
}

for _, tc := range tests {
Expand Down Expand Up @@ -5892,7 +5897,7 @@ func Test_GrafanaAgent(t *testing.T) {

for _, tc := range tests {
t.Run(tc.os+" "+tc.arch+" "+tc.version, func(r *testing.T) {
fmt.Println(tc)

got, err := tool.GetURL(tc.os, tc.arch, tc.version, false)
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -5946,7 +5951,7 @@ func Test_ScalewayCli(t *testing.T) {

for _, tc := range tests {
t.Run(tc.os+" "+tc.arch+" "+tc.version, func(r *testing.T) {
fmt.Println(tc)

got, err := tool.GetURL(tc.os, tc.arch, tc.version, false)
if err != nil {
t.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/get/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ https://github.com/inlets/inletsctl/releases/download/{{.Version}}/{{$fileName}}
{{- if eq .Arch "x86_64" -}}
{{$archStr = "amd64"}}
{{- else if eq .Arch "armv7l" }}
{{$archStr = "arm64"}}
{{$archStr = ""}}
{{- else if eq .Arch "aarch64" }}
{{$archStr = "arm64"}}
{{- end -}}
Expand Down

0 comments on commit 1ea9ef1

Please sign in to comment.