Skip to content

Commit

Permalink
feat: add crossplane CLI (crank) to tools
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Gee <[email protected]>
  • Loading branch information
rgee0 authored and alexellis committed Oct 26, 2024
1 parent c7dc5c9 commit b8766b4
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,7 @@ There are 52 apps that you can install on your cluster.
| [cr](https://github.com/helm/chart-releaser) | Hosting Helm Charts via GitHub Pages and Releases |
| [crane](https://github.com/google/go-containerregistry) | crane is a tool for interacting with remote images and registries |
| [croc](https://github.com/schollz/croc) | Easily and securely send things from one computer to another |
| [crossplane](https://github.com/crossplane/crossplane) | Simplify some development and administration aspects of Crossplane. |
| [dagger](https://github.com/dagger/dagger) | A portable devkit for CI/CD pipelines. |
| [devspace](https://github.com/devspace-sh/devspace) | Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes. |
| [dive](https://github.com/wagoodman/dive) | A tool for exploring each layer in a docker image |
Expand Down Expand Up @@ -915,6 +916,7 @@ 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 157 tools, use `arkade get NAME` to download one.

There are 158 tools, use `arkade get NAME` to download one.

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

func Test_Crossplane(t *testing.T) {
tools := MakeTools()
name := "crossplane"

tool := getTool(name, tools)

const toolVersion = "v1.17.2"

tests := []test{
{
os: "darwin",
arch: arch64bit,
version: toolVersion,
url: `https://releases.crossplane.io/stable/v1.17.2/bin/darwin_amd64/crank`,
},
{
os: "darwin",
arch: archDarwinARM64,
version: toolVersion,
url: `https://releases.crossplane.io/stable/v1.17.2/bin/darwin_arm64/crank`,
},
{
os: "linux",
arch: arch64bit,
version: toolVersion,
url: `https://releases.crossplane.io/stable/v1.17.2/bin/linux_amd64/crank`,
},
{
os: "linux",
arch: archARM64,
version: toolVersion,
url: `https://releases.crossplane.io/stable/v1.17.2/bin/linux_arm64/crank`,
},
{
os: "linux",
arch: archARM7,
version: toolVersion,
url: `https://releases.crossplane.io/stable/v1.17.2/bin/linux_arm/crank`,
},
{
os: "ming",
arch: arch64bit,
version: toolVersion,
url: `https://releases.crossplane.io/stable/v1.17.2/bin/windows_amd64/crank.exe`,
},
}

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\ngot: %s", tc.url, got)
}
}

}
26 changes: 26 additions & 0 deletions pkg/get/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -4327,5 +4327,31 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}}
duplik8s_{{$os}}_{{$arch}}.{{$ext}}
`,
})
tools = append(tools,
Tool{
Owner: "crossplane",
Repo: "crossplane",
Name: "crossplane",
VersionStrategy: GitHubVersionStrategy,
Description: "Simplify some development and administration aspects of Crossplane.",
URLTemplate: `
{{$arch := .Arch}}
{{$ext := "" }}
{{- if (or (eq .Arch "x86_64") (eq .Arch "amd64")) -}}
{{$arch = "amd64"}}
{{- else if (or (eq .Arch "aarch64") (eq .Arch "arm64")) -}}
{{$arch = "arm64"}}
{{- else if eq .Arch "armv7l" -}}
{{ $arch = "arm" }}
{{- end -}}
{{$os := .OS}}
{{ if HasPrefix .OS "ming" -}}
{{$ext = ".exe" }}
{{$os = "windows"}}
{{- end -}}
https://releases.crossplane.io/stable/{{.Version}}/bin/{{$os}}_{{$arch}}/crank{{$ext}}`,
})
return tools
}

0 comments on commit b8766b4

Please sign in to comment.