From 5a86ed75cf37cf3344f1ae45d136f9f26a600de9 Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Thu, 14 Sep 2023 10:31:16 +0100 Subject: [PATCH] Fix Windows template for K9s Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- pkg/get/get_test.go | 2 +- pkg/get/tools.go | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/get/get_test.go b/pkg/get/get_test.go index d1a8c23ac..1cc51271a 100644 --- a/pkg/get/get_test.go +++ b/pkg/get/get_test.go @@ -1119,7 +1119,7 @@ func Test_DownloadK9s(t *testing.T) { {os: "ming", arch: arch64bit, version: toolVersion, - url: `https://github.com/derailed/k9s/releases/download/v0.24.10/k9s_Windows_amd64.tar.gz`, + url: `https://github.com/derailed/k9s/releases/download/v0.24.10/k9s_Windows_amd64.zip`, }, {os: "linux", arch: arch64bit, diff --git a/pkg/get/tools.go b/pkg/get/tools.go index 633edbdd7..0ea07d349 100644 --- a/pkg/get/tools.go +++ b/pkg/get/tools.go @@ -730,6 +730,12 @@ https://github.com/inlets/inletsctl/releases/download/{{.Version}}/{{$fileName}} Name: "k9s", Description: "Provides a terminal UI to interact with your Kubernetes clusters.", BinaryTemplate: ` + + {{$extStr := "tar.gz"}} + {{ if HasPrefix .OS "ming" -}} + {{$extStr = "zip"}} + {{- end -}} + {{$os := "" }} {{ if HasPrefix .OS "ming" -}} {{$os = "Windows"}} @@ -748,7 +754,7 @@ https://github.com/inlets/inletsctl/releases/download/{{.Version}}/{{$fileName}} {{$arch = "arm"}} {{- end -}} - {{.Name}}_{{$os}}_{{$arch}}.tar.gz`, + {{.Name}}_{{$os}}_{{$arch}}.{{$extStr}}`, }) tools = append(tools,