Skip to content

Commit

Permalink
Comment out kubestr due to invalid release
Browse files Browse the repository at this point in the history
kastenhq/kubestr#160

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Jul 25, 2023
1 parent 41ed7ec commit 12d550b
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 78 deletions.
100 changes: 51 additions & 49 deletions pkg/get/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2907,57 +2907,59 @@ func Test_DownloadKanister(t *testing.T) {
}
}

func Test_DownloadKubestr(t *testing.T) {
tools := MakeTools()
name := "kubestr"
v := "v0.4.31"
tool := getTool(name, tools)
// Commented out due to: https://github.com/kastenhq/kubestr/issues/160

tests := []test{
{
os: "darwin",
arch: arch64bit,
version: v,
url: `https://github.com/kastenhq/kubestr/releases/download/v0.4.31/kubestr_0.4.31_MacOS_amd64.tar.gz`,
},
{
os: "darwin",
arch: archDarwinARM64,
version: v,
url: `https://github.com/kastenhq/kubestr/releases/download/v0.4.31/kubestr_0.4.31_MacOS_arm64.tar.gz`,
},
{
os: "linux",
arch: arch64bit,
version: v,
url: `https://github.com/kastenhq/kubestr/releases/download/v0.4.31/kubestr_0.4.31_Linux_amd64.tar.gz`,
},
{
os: "linux",
arch: archARM64,
version: v,
url: `https://github.com/kastenhq/kubestr/releases/download/v0.4.31/kubestr_0.4.31_Linux_arm64.tar.gz`,
},
{
os: "ming",
arch: arch64bit,
version: v,
url: `https://github.com/kastenhq/kubestr/releases/download/v0.4.31/kubestr_0.4.31_Windows_amd64.tar.gz`,
},
}
// func Test_DownloadKubestr(t *testing.T) {
// tools := MakeTools()
// name := "kubestr"
// v := "v0.4.31"
// tool := getTool(name, tools)

for _, tc := range tests {
t.Run(tc.os+" "+tc.arch+" "+tc.version, func(r *testing.T) {
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)
}
})
}
}
// tests := []test{
// {
// os: "darwin",
// arch: arch64bit,
// version: v,
// url: `https://github.com/kastenhq/kubestr/releases/download/v0.4.31/kubestr_0.4.31_MacOS_amd64.tar.gz`,
// },
// {
// os: "darwin",
// arch: archDarwinARM64,
// version: v,
// url: `https://github.com/kastenhq/kubestr/releases/download/v0.4.31/kubestr_0.4.31_MacOS_arm64.tar.gz`,
// },
// {
// os: "linux",
// arch: arch64bit,
// version: v,
// url: `https://github.com/kastenhq/kubestr/releases/download/v0.4.31/kubestr_0.4.31_Linux_amd64.tar.gz`,
// },
// {
// os: "linux",
// arch: archARM64,
// version: v,
// url: `https://github.com/kastenhq/kubestr/releases/download/v0.4.31/kubestr_0.4.31_Linux_arm64.tar.gz`,
// },
// {
// os: "ming",
// arch: arch64bit,
// version: v,
// url: `https://github.com/kastenhq/kubestr/releases/download/v0.4.31/kubestr_0.4.31_Windows_amd64.tar.gz`,
// },
// }

// for _, tc := range tests {
// t.Run(tc.os+" "+tc.arch+" "+tc.version, func(r *testing.T) {
// 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_DownloadK10multicluster(t *testing.T) {
tools := MakeTools()
Expand Down
59 changes: 30 additions & 29 deletions pkg/get/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -1860,35 +1860,36 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Repo}}
BinaryTemplate: `{{.Name}}`,
})

tools = append(tools,
Tool{
Owner: "kastenhq",
Repo: "kubestr",
Name: "kubestr",
Description: "Kubestr discovers, validates and evaluates your Kubernetes storage options.",

URLTemplate: `
{{ $ext := "tar.gz" }}
{{ $osStr := "Linux" }}
{{ $arch := .Arch }}
{{- if eq .Arch "x86_64" -}}
{{$arch = "amd64"}}
{{- end -}}
{{- if eq .Arch "aarch64" -}}
{{$arch = "arm64"}}
{{- end -}}
{{- if eq .OS "darwin" -}}
{{ $osStr = "MacOS" }}
{{- else if HasPrefix .OS "ming" -}}
{{ $osStr = "Windows" }}
{{- end -}}
https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}_{{.VersionNumber}}_{{$osStr}}_{{$arch}}.{{$ext}}`,
BinaryTemplate: `{{.Name}}`,
})
// Commented out due to: https://github.com/kastenhq/kubestr/issues/160
// tools = append(tools,
// Tool{
// Owner: "kastenhq",
// Repo: "kubestr",
// Name: "kubestr",
// Description: "Kubestr discovers, validates and evaluates your Kubernetes storage options.",

// URLTemplate: `
// {{ $ext := "tar.gz" }}
// {{ $osStr := "Linux" }}
// {{ $arch := .Arch }}

// {{- if eq .Arch "x86_64" -}}
// {{$arch = "amd64"}}
// {{- end -}}

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

// {{- if eq .OS "darwin" -}}
// {{ $osStr = "MacOS" }}
// {{- else if HasPrefix .OS "ming" -}}
// {{ $osStr = "Windows" }}
// {{- end -}}

// https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}_{{.VersionNumber}}_{{$osStr}}_{{$arch}}.{{$ext}}`,
// BinaryTemplate: `{{.Name}}`,
// })

tools = append(tools,
Tool{
Expand Down

0 comments on commit 12d550b

Please sign in to comment.