Skip to content

Commit

Permalink
add support for lazydocker
Browse files Browse the repository at this point in the history
Signed-off-by: Nitishkumar Singh <[email protected]>
  • Loading branch information
nitishkumar71 authored and alexellis committed Jun 12, 2024
1 parent e4283fd commit 5d9f17f
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@ There are 56 apps that you can install on your cluster.
| [kwok](https://github.com/kubernetes-sigs/kwok) | KWOK stands for Kubernetes WithOut Kubelet, responsible for simulating the lifecycle of fake nodes, pods, and other Kubernetes API resources |
| [kwokctl](https://github.com/kubernetes-sigs/kwok) | CLI tool designed to streamline the creation and management of clusters, with nodes simulated by `kwok` |
| [kyverno](https://github.com/kyverno/kyverno) | CLI to apply and test Kyverno policies outside a cluster. |
| [lazydocker](https://github.com/jesseduffield/lazydocker) | A simple terminal UI for both docker and docker-compose, written in Go with the gocui library. |
| [lazygit](https://github.com/jesseduffield/lazygit) | A simple terminal UI for git commands. |
| [linkerd2](https://github.com/linkerd/linkerd2) | Ultralight, security-first service mesh for Kubernetes. |
| [mc](https://github.com/minio/mc) | MinIO Client is a replacement for ls, cp, mkdir, diff and rsync commands for filesystems and object storage. |
Expand Down Expand Up @@ -916,6 +917,6 @@ There are 56 apps that you can install on your cluster.
| [waypoint](https://github.com/hashicorp/waypoint) | Easy application deployment for Kubernetes and Amazon ECS |
| [yq](https://github.com/mikefarah/yq) | Portable command-line YAML processor. |
| [yt-dlp](https://github.com/yt-dlp/yt-dlp) | Fork of youtube-dl with additional features and fixes |
There are 154 tools, use `arkade get NAME` to download one.
There are 155 tools, use `arkade get NAME` to download one.

> Note to contributors, run `arkade get --format markdown` to generate this list
95 changes: 95 additions & 0 deletions pkg/get/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7679,3 +7679,98 @@ func Test_DownloadKubeColor(t *testing.T) {
}

}

func Test_DownloadLazyDocker(t *testing.T) {
tools := MakeTools()
name := "lazydocker"

tool := getTool(name, tools)

const toolVersion = "v0.23.3"

tests := []test{
{
os: "linux",
arch: arch64bit,
version: toolVersion,
url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Linux_x86_64.tar.gz",
},
{
os: "linux",
arch: archARM64,
version: toolVersion,
url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Linux_arm64.tar.gz",
},
{
os: "linux",
arch: "armv6l",
version: toolVersion,
url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Linux_armv6.tar.gz",
},
{
os: "linux",
arch: archARM7,
version: toolVersion,
url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Linux_armv7.tar.gz",
},
{
os: "darwin",
arch: arch64bit,
version: toolVersion,
url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Darwin_x86_64.tar.gz",
},
{
os: "darwin",
arch: archDarwinARM64,
version: toolVersion,
url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Darwin_arm64.tar.gz",
},
{
os: "darwin",
arch: "armv6l",
version: toolVersion,
url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Darwin_armv6.tar.gz",
},
{
os: "darwin",
arch: archARM7,
version: toolVersion,
url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Darwin_armv7.tar.gz",
},
{
os: "ming",
arch: archARM64,
version: toolVersion,
url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Windows_arm64.zip",
},
{
os: "ming",
arch: arch64bit,
version: toolVersion,
url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Windows_x86_64.zip",
},
{
os: "ming",
arch: "armv6l",
version: toolVersion,
url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Windows_armv6.zip",
},
{
os: "ming",
arch: archARM7,
version: toolVersion,
url: "https://github.com/jesseduffield/lazydocker/releases/download/v0.23.3/lazydocker_0.23.3_Windows_armv7.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("\nwant: %s, \n got: %s", tc.url, got)
}
}

}
34 changes: 34 additions & 0 deletions pkg/get/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -4244,5 +4244,39 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Repo}}
{{.Name}}_{{.VersionNumber}}_{{$os}}_{{$arch}}.{{$ext}}`,
})

tools = append(tools,
Tool{
Owner: "jesseduffield",
Repo: "lazydocker",
Name: "lazydocker",
Description: "A simple terminal UI for both docker and docker-compose, written in Go with the gocui library.",
BinaryTemplate: `
{{$os := .OS}}
{{$arch := .Arch}}
{{$ext := "tar.gz"}}
{{ if HasPrefix .OS "ming" -}}
{{$ext = "zip"}}
{{- end -}}
{{- if eq .Arch "aarch64" -}}
{{$arch = "arm64"}}
{{- else if eq .Arch "armv6l" -}}
{{ $arch = "armv6" }}
{{- else if eq .Arch "armv7l" -}}
{{ $arch = "armv7" }}
{{- end -}}
{{$osStr := ""}}
{{ if HasPrefix .OS "ming" -}}
{{$osStr = "Windows"}}
{{- else if eq .OS "linux" -}}
{{$osStr = "Linux"}}
{{- else if eq .OS "darwin" -}}
{{$osStr = "Darwin"}}
{{- end -}}
{{.Name}}_{{.VersionNumber}}_{{$osStr}}_{{$arch}}.{{$ext}}`,
})
return tools
}

0 comments on commit 5d9f17f

Please sign in to comment.