Skip to content

Commit 7753c60

Browse files
weltekialexellis
authored andcommitted
Fix opencode binary templates
Getting OpenCode on linux failed with 404 response. Starting with v1.0.92 of OpenCode Linux releases use tar.gz instead of .zip Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
1 parent b82c4c8 commit 7753c60

File tree

2 files changed

+49
-49
lines changed

2 files changed

+49
-49
lines changed

pkg/get/get_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9189,13 +9189,13 @@ func Test_DownloadOpencode(t *testing.T) {
91899189
os: "linux",
91909190
arch: arch64bit,
91919191
version: toolVersion,
9192-
url: "https://github.com/sst/opencode/releases/download/v0.4.41/opencode-linux-x64.zip",
9192+
url: "https://github.com/sst/opencode/releases/download/v0.4.41/opencode-linux-x64.tar.gz",
91939193
},
91949194
{
91959195
os: "linux",
91969196
arch: archARM64,
91979197
version: toolVersion,
9198-
url: "https://github.com/sst/opencode/releases/download/v0.4.41/opencode-linux-arm64.zip",
9198+
url: "https://github.com/sst/opencode/releases/download/v0.4.41/opencode-linux-arm64.tar.gz",
91999199
},
92009200
{
92019201
os: "mingw64_nt-10.0-18362",

pkg/get/tools.go

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ func MakeTools() Tools {
6464
{{.Name}}-darwin-x64.zip
6565
{{- end -}}
6666
{{- else if or (eq .Arch "aarch64") (eq .Arch "arm64") -}}
67-
{{.Name}}-linux-arm64.zip
67+
{{.Name}}-linux-arm64.tar.gz
6868
{{- else -}}
69-
{{.Name}}-linux-x64.zip
69+
{{.Name}}-linux-x64.tar.gz
7070
{{- end -}}`,
7171
})
7272

@@ -971,12 +971,12 @@ kluctl_{{.Version}}_{{$os}}_{{$arch}}.{{if HasPrefix .OS "ming"}}zip{{else}}tar.
971971
{{- else if eq .Arch "armv7l" -}}
972972
{{$arch = "arm"}}
973973
{{- end -}}
974-
974+
975975
{{$os := .OS}}
976976
{{ if HasPrefix .OS "ming" -}}
977977
{{$os = "windows"}}
978978
{{- end -}}
979-
979+
980980
https://releases.hashicorp.com/{{.Name}}/{{.VersionNumber}}/{{.Name}}_{{.VersionNumber}}_{{$os}}_{{$arch}}.zip`,
981981
})
982982

@@ -1108,18 +1108,18 @@ https://releases.hashicorp.com/{{.Name}}/{{.VersionNumber}}/{{.Name}}_{{.Version
11081108
Version: "2.2.19",
11091109
Description: "Tool for building and distributing development environments.",
11101110
URLTemplate: `{{$arch := .Arch}}
1111-
1111+
11121112
{{- if eq .Arch "x86_64" -}}
11131113
{{$arch = "amd64"}}
11141114
{{- else if eq .Arch "armv7l" -}}
11151115
{{$arch = "arm"}}
11161116
{{- end -}}
1117-
1117+
11181118
{{$os := .OS}}
11191119
{{ if HasPrefix .OS "ming" -}}
11201120
{{$os = "windows"}}
11211121
{{- end -}}
1122-
1122+
11231123
https://releases.hashicorp.com/{{.Name}}/{{.Version}}/{{.Name}}_{{.Version}}_{{$os}}_{{$arch}}.zip`})
11241124

11251125
tools = append(tools,
@@ -2289,12 +2289,12 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
22892289
{{$os := .OS}}
22902290
{{$arch := .Arch}}
22912291
{{$ext := ".tar.gz"}}
2292-
2292+
22932293
{{- if HasPrefix .OS "ming" -}}
22942294
{{$os = "windows"}}
22952295
{{$ext = ".zip"}}
22962296
{{- end -}}
2297-
2297+
22982298
{{- if eq .Arch "x86_64" -}}
22992299
{{$arch = "amd64"}}
23002300
{{- else if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
@@ -4238,11 +4238,11 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
42384238
{{ $os := .OS }}
42394239
{{ $arch := .Arch }}
42404240
{{ $ext := "" }}
4241-
4241+
42424242
{{- if (eq .Arch "aarch64") -}}
42434243
{{ $ext = "-aarch64" }}
42444244
{{- end -}}
4245-
4245+
42464246
cloud-hypervisor-static{{$ext}}`,
42474247
})
42484248

@@ -4256,11 +4256,11 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
42564256
{{ $os := .OS }}
42574257
{{ $arch := .Arch }}
42584258
{{ $ext := "" }}
4259-
4259+
42604260
{{- if (eq .Arch "aarch64") -}}
42614261
{{ $ext = "-aarch64" }}
42624262
{{- end -}}
4263-
4263+
42644264
ch-remote-static{{$ext}}`,
42654265
})
42664266

@@ -4322,7 +4322,7 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
43224322
{{ if HasPrefix .OS "ming" -}}
43234323
{{$os = "windows"}}
43244324
{{$ext = ".exe"}}
4325-
{{- end -}}
4325+
{{- end -}}
43264326
43274327
regctl-{{$os}}-{{$arch}}{{$ext}}
43284328
`,
@@ -4382,18 +4382,18 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
43824382
{{$os := .OS}}
43834383
{{$arch := .Arch}}
43844384
{{$ext := "tar.gz"}}
4385-
4385+
43864386
{{- if HasPrefix .OS "ming" -}}
43874387
{{ $os = "windows" }}
43884388
{{ $ext = "exe" }}
43894389
{{- end -}}
4390-
4390+
43914391
{{- if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
43924392
{{$arch = "arm64"}}
43934393
{{- else if eq .Arch "x86_64" -}}
43944394
{{ $arch = "amd64" }}
43954395
{{- end -}}
4396-
4396+
43974397
{{.Name}}_{{.VersionNumber}}_{{$os}}_{{$arch}}.{{$ext}}`,
43984398
})
43994399

@@ -4454,9 +4454,9 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
44544454
{{ if HasPrefix .OS "ming" -}}
44554455
{{$os = "windows"}}
44564456
{{ $ext := "tar.gz" }}
4457-
4457+
44584458
{{- end -}}
4459-
4459+
44604460
{{- if eq .OS "darwin" -}}
44614461
{{$os = "darwin"}}
44624462
{{$arch = "all"}}
@@ -4477,19 +4477,19 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
44774477
{{ $os := .OS }}
44784478
{{ $arch := .Arch }}
44794479
{{ $ext := "tar.gz" }}
4480-
4480+
44814481
{{- if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
44824482
{{ $arch = "arm64" }}
44834483
{{- else if eq .Arch "x86_64" -}}
44844484
{{ $arch = "amd64" }}
44854485
{{- end -}}
4486-
4486+
44874487
{{- if eq .OS "darwin" -}}
44884488
{{$os = "darwin"}}
44894489
{{- else if eq .OS "linux" -}}
44904490
{{ $os = "linux" }}
44914491
{{- end -}}
4492-
4492+
44934493
labctl_{{$os}}_{{$arch}}.{{$ext}}
44944494
`,
44954495
})
@@ -4532,22 +4532,22 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
45324532
{{ $os := .OS }}
45334533
{{ $arch := .Arch }}
45344534
{{ $ext := "tar.gz" }}
4535-
4535+
45364536
{{- if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
45374537
{{ $arch = "arm64" }}
45384538
{{- end -}}
4539-
4539+
45404540
{{ if HasPrefix .OS "ming" -}}
45414541
{{$os = "Windows"}}
45424542
{{ $ext = "zip" }}
45434543
{{- end -}}
4544-
4544+
45454545
{{- if eq .OS "darwin" -}}
45464546
{{$os = "Darwin"}}
45474547
{{- else if eq .OS "linux" -}}
45484548
{{ $os = "Linux" }}
45494549
{{- end -}}
4550-
4550+
45514551
duplik8s_{{$os}}_{{$arch}}.{{$ext}}
45524552
`,
45534553
})
@@ -4568,13 +4568,13 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
45684568
{{- else if eq .Arch "armv7l" -}}
45694569
{{ $arch = "arm" }}
45704570
{{- end -}}
4571-
4571+
45724572
{{$os := .OS}}
45734573
{{ if HasPrefix .OS "ming" -}}
45744574
{{$ext = ".exe" }}
45754575
{{$os = "windows"}}
45764576
{{- end -}}
4577-
4577+
45784578
https://releases.crossplane.io/stable/{{.Version}}/bin/{{$os}}_{{$arch}}/crank{{$ext}}`,
45794579
})
45804580

@@ -4589,7 +4589,7 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
45894589
{{$os := .OS}}
45904590
{{$arch := .Arch}}
45914591
{{$ext := "tar.gz"}}
4592-
4592+
45934593
{{- if eq .OS "darwin" -}}
45944594
{{$os = "Darwin"}}
45954595
{{- else if eq .OS "linux" -}}
@@ -4598,11 +4598,11 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
45984598
{{$os = "Windows"}}
45994599
{{$ext = "zip"}}
46004600
{{- end -}}
4601-
4601+
46024602
{{- if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
46034603
{{$arch = "arm64"}}
46044604
{{- end -}}
4605-
4605+
46064606
rosa_{{$os}}_{{$arch}}.{{$ext}}
46074607
`,
46084608
})
@@ -4617,15 +4617,15 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
46174617
BinaryTemplate: `
46184618
{{$os := .OS}}
46194619
{{$arch := .Arch}}
4620-
4620+
46214621
{{- if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
46224622
{{$arch = "arm64"}}
46234623
{{- else if eq .Arch "x86_64" -}}
46244624
{{$arch = "amd64"}}
46254625
{{- else if eq .Arch "armv7l" -}}
46264626
{{$arch = "arm32"}}
46274627
{{- end -}}
4628-
4628+
46294629
kubie-{{$os}}-{{$arch}}
46304630
`,
46314631
})
@@ -4645,7 +4645,7 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
46454645
{{- if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
46464646
{{$arch = "arm64"}}
46474647
{{- end -}}
4648-
4648+
46494649
{{- if eq .OS "darwin" -}}
46504650
{{$os = "Darwin"}}
46514651
{{$arch = "all"}}
@@ -4655,7 +4655,7 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
46554655
{{$os = "Windows"}}
46564656
{{$ext = ".exe"}}
46574657
{{- end -}}
4658-
4658+
46594659
eks-node-viewer_{{$os}}_{{$arch}}{{$ext}}
46604660
`,
46614661
})
@@ -4671,23 +4671,23 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
46714671
{{$os := .OS}}
46724672
{{$arch := .Arch}}
46734673
{{$ext := "zip"}}
4674-
4674+
46754675
{{- if eq .OS "darwin" -}}
46764676
{{$os = "osx"}}
46774677
{{- else if eq .OS "linux" -}}
46784678
{{$os = "linux"}}
46794679
{{- else if HasPrefix .OS "ming" -}}
46804680
{{$os = "windows"}}
46814681
{{- end -}}
4682-
4682+
46834683
{{- if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
46844684
{{$arch = "arm64"}}
46854685
{{- else if eq .Arch "x86_64" -}}
46864686
{{$arch = "amd64"}}
46874687
{{- else if eq .Arch "armv7l" -}}
46884688
{{$arch = "arm-v7"}}
46894689
{{- end -}}
4690-
4690+
46914691
rclone-{{.Version}}-{{$os}}-{{$arch}}.{{$ext}}
46924692
`,
46934693
})
@@ -4772,15 +4772,15 @@ https://github.com/grafana/alloy/releases/download/{{.Version}}/{{$fileName}}`,
47724772
{{$os := .OS}}
47734773
{{$arch := .Arch}}
47744774
{{$ext := "tar.gz"}}
4775-
4775+
47764776
{{- if eq .Arch "x86_64" -}}
47774777
{{$arch = "amd64"}}
47784778
{{- else if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
47794779
{{$arch = "arm64"}}
47804780
{{- else if eq .Arch "armv7l" -}}
47814781
{{$arch = "arm"}}
47824782
{{- end -}}
4783-
4783+
47844784
gitwho_{{.Version}}_{{$os}}_{{$arch}}.{{$ext}}
47854785
`,
47864786
})
@@ -4795,18 +4795,18 @@ https://github.com/grafana/alloy/releases/download/{{.Version}}/{{$fileName}}`,
47954795
{{$os := .OS}}
47964796
{{$arch := .Arch}}
47974797
{{$ext := "tar.gz"}}
4798-
4798+
47994799
{{- if eq .Arch "x86_64" -}}
48004800
{{$arch = "x64"}}
48014801
{{- else if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
48024802
{{$arch = "arm64"}}
48034803
{{- end -}}
4804-
4804+
48054805
{{- if HasPrefix .OS "ming" -}}
48064806
{{$os = "windows"}}
48074807
{{$ext = "zip"}}
48084808
{{- end -}}
4809-
4809+
48104810
{{.Name}}-{{.Version}}-{{$os}}-{{$arch}}.{{$ext}}
48114811
`,
48124812
})
@@ -5047,11 +5047,11 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/dyff_{{.V
50475047
{{- else if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
50485048
{{$arch = "arm64"}}
50495049
{{- end -}}
5050-
5050+
50515051
{{- if HasPrefix .OS "ming" -}}
50525052
{{$os = "windows"}}
50535053
{{- end -}}
5054-
5054+
50555055
{{.Name}}-{{$os}}-{{$arch}}`,
50565056
URLTemplate: `
50575057
{{$os := .OS}}
@@ -5064,12 +5064,12 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/dyff_{{.V
50645064
{{- else if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
50655065
{{$arch = "arm64"}}
50665066
{{- end -}}
5067-
5067+
50685068
{{- if HasPrefix .OS "ming" -}}
50695069
{{$os = "windows"}}
50705070
{{$ext = "exe.zip"}}
50715071
{{- end -}}
5072-
5072+
50735073
https://github.com/grafana/loki/releases/download/{{.Version}}/{{.Name}}-{{$os}}-{{$arch}}.{{$ext}}`,
50745074
})
50755075

0 commit comments

Comments
 (0)