From 0f87fbd642f015534b384da9b29626d04a360cf2 Mon Sep 17 00:00:00 2001 From: Richard Gee Date: Sun, 29 Sep 2024 08:10:45 +0100 Subject: [PATCH] feat: add labctl to tools Signed-off-by: Richard Gee --- .gitignore | 1 + README.md | 7 ++++--- pkg/get/get_test.go | 38 ++++++++++++++++++++++++++++++++++++++ pkg/get/tools.go | 26 ++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8a91f86a2..6f6a14bd4 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ kubeconfig mc /arkade-* /faas-cli* +test.out diff --git a/README.md b/README.md index 5d0c6f19e..a6bc1af79 100644 --- a/README.md +++ b/README.md @@ -824,8 +824,8 @@ There are 52 apps that you can install on your cluster. | [k3s](https://github.com/k3s-io/k3s) | Lightweight Kubernetes | | [k3sup](https://github.com/alexellis/k3sup) | Bootstrap Kubernetes with k3s over SSH < 1 min. | | [k9s](https://github.com/derailed/k9s) | Provides a terminal UI to interact with your Kubernetes clusters. | -| [kail](https://github.com/boz/kail) | Kubernetes log viewer. -| [keploy](https://github.com/keploy/keploy) | Generate tests and stubs for your application that actually work! | +| [kail](https://github.com/boz/kail) | Kubernetes log viewer. | +| [keploy](https://github.com/keploy/keploy) | Test generation for Developers. Generate tests and stubs for your application that actually work! | | [kgctl](https://github.com/squat/kilo) | A CLI to manage Kilo, a multi-cloud network overlay built on WireGuard and designed for Kubernetes. | | [kim](https://github.com/rancher/kim) | Build container images inside of Kubernetes. (Experimental) | | [kind](https://github.com/kubernetes-sigs/kind) | Run local Kubernetes clusters using Docker container nodes. | @@ -853,6 +853,7 @@ There are 52 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. | +| [labctl](https://github.com/iximiuz/labctl) | iximiuz Labs control - start remote microVM playgrounds from the command line. | | [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. | @@ -912,6 +913,6 @@ There are 52 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 153 tools, use `arkade get NAME` to download one. +There are 155 tools, use `arkade get NAME` to download one. > Note to contributors, run `go build && ./arkade get --format markdown` to generate this list \ No newline at end of file diff --git a/pkg/get/get_test.go b/pkg/get/get_test.go index c67a56145..19921efd3 100644 --- a/pkg/get/get_test.go +++ b/pkg/get/get_test.go @@ -7778,3 +7778,41 @@ func Test_Download_k0sctl(t *testing.T) { } } } + +func Test_Download_labctl(t *testing.T) { + tools := MakeTools() + name := "labctl" + const toolVersion = "v0.1.8" + + tool := getTool(name, tools) + + tests := []test{ + { + os: "darwin", + arch: arch64bit, + version: toolVersion, + url: "https://github.com/iximiuz/labctl/releases/download/v0.1.8/labctl_darwin_amd64.tar.gz", + }, + { + os: "darwin", + arch: archDarwinARM64, + version: toolVersion, + url: "https://github.com/iximiuz/labctl/releases/download/v0.1.8/labctl_darwin_arm64.tar.gz", + }, + { + os: "linux", + arch: arch64bit, + version: toolVersion, + url: "https://github.com/iximiuz/labctl/releases/download/v0.1.8/labctl_linux_amd64.tar.gz", + }, + } + 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.Fatalf("\nwant: %s\ngot: %s", tc.url, got) + } + } +} diff --git a/pkg/get/tools.go b/pkg/get/tools.go index 989d22516..a8c83bb38 100644 --- a/pkg/get/tools.go +++ b/pkg/get/tools.go @@ -4240,5 +4240,31 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}} keploy_{{$os}}_{{$arch}}.{{$ext}} `, }) + tools = append(tools, + Tool{ + Owner: "iximiuz", + Repo: "labctl", + Name: "labctl", + Description: "iximiuz Labs control - start remote microVM playgrounds from the command line.", + BinaryTemplate: ` + {{ $os := .OS }} + {{ $arch := .Arch }} + {{ $ext := "tar.gz" }} + + {{- if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}} + {{ $arch = "arm64" }} + {{- else if eq .Arch "x86_64" -}} + {{ $arch = "amd64" }} + {{- end -}} + + {{- if eq .OS "darwin" -}} + {{$os = "darwin"}} + {{- else if eq .OS "linux" -}} + {{ $os = "linux" }} + {{- end -}} + + labctl_{{$os}}_{{$arch}}.{{$ext}} + `, + }) return tools }