Skip to content

Commit

Permalink
Add etcd CLI to arkade
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Harding <kyle@balena.io>
  • Loading branch information
klutchell committed Jul 27, 2023
1 parent 12d550b commit 74dcb1c
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ There are 56 apps that you can install on your cluster.
| [doctl](https://github.com/digitalocean/doctl) | Official command line interface for the DigitalOcean API. |
| [eksctl](https://github.com/eksctl-io/eksctl) | Amazon EKS Kubernetes cluster management |
| [eksctl-anywhere](https://github.com/aws/eks-anywhere) | Run Amazon EKS on your own infrastructure |
| [etcd](https://github.com/etcd-io/etcd) | Distributed reliable key-value store for the most critical data of a distributed system. |
| [faas-cli](https://github.com/openfaas/faas-cli) | Official CLI for OpenFaaS. |
| [firectl](https://github.com/firecracker-microvm/firectl) | Command-line tool that lets you run arbitrary Firecracker MicroVMs |
| [flux](https://github.com/fluxcd/flux2) | Continuous Delivery solution for Kubernetes powered by GitOps Toolkit. |
Expand Down Expand Up @@ -860,6 +861,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 137 tools, use `arkade get NAME` to download one.
There are 138 tools, use `arkade get NAME` to download one.

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

func Test_DownloadEtcd(t *testing.T) {
tools := MakeTools()
name := "etcd"

tool := getTool(name, tools)

const toolVersion = "v3.5.9"

tests := []test{
{
os: "linux",
arch: arch64bit,
version: toolVersion,
url: `https://github.com/etcd-io/etcd/releases/download/v3.5.9/etcd-v3.5.9-linux-amd64.tar.gz`,
},
{
os: "darwin",
arch: arch64bit,
version: toolVersion,
url: `https://github.com/etcd-io/etcd/releases/download/v3.5.9/etcd-v3.5.9-darwin-amd64.zip`,
},
{
os: "darwin",
arch: archDarwinARM64,
version: toolVersion,
url: `https://github.com/etcd-io/etcd/releases/download/v3.5.9/etcd-v3.5.9-darwin-arm64.zip`,
},
{
os: "linux",
arch: archARM64,
version: toolVersion,
url: `https://github.com/etcd-io/etcd/releases/download/v3.5.9/etcd-v3.5.9-linux-arm64.tar.gz`,
},
{
os: "ming",
arch: arch64bit,
version: toolVersion,
url: `https://github.com/etcd-io/etcd/releases/download/v3.5.9/etcd-v3.5.9-windows-amd64.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("want: %s, got: %s", tc.url, got)
}
}
}

func Test_DownloadCivo(t *testing.T) {
tools := MakeTools()
name := "civo"
Expand Down
28 changes: 28 additions & 0 deletions pkg/get/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,34 @@ https://storage.googleapis.com/kubernetes-release/release/{{.Version}}/bin/{{$os
{{- end -}}`,
})

tools = append(tools,
Tool{
Owner: "etcd-io",
Repo: "etcd",
Name: "etcd",
Description: "Distributed reliable key-value store for the most critical data of a distributed system.",
BinaryTemplate: `
{{$ext := "zip"}}
{{- if eq .OS "linux" -}}
{{$ext = "tar.gz"}}
{{- end -}}
{{$arch := .Arch}}
{{ if (eq .Arch "x86_64") -}}
{{$arch = "amd64"}}
{{- else if eq .Arch "aarch64" -}}
{{$arch = "arm64"}}
{{- end -}}
{{$osString:= .OS}}
{{ if HasPrefix .OS "ming" -}}
{{$osString = "windows"}}
{{- end -}}
{{.Name}}-{{.Version}}-{{$osString}}-{{$arch}}.{{$ext}}
`,
})

tools = append(tools,
Tool{
Owner: "cnrancher",
Expand Down

0 comments on commit 74dcb1c

Please sign in to comment.