Skip to content

Commit

Permalink
add support for regctl
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 Mar 20, 2024
1 parent acb1bd9 commit 6cf4a64
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ There are 56 apps that you can install on your cluster.
| [popeye](https://github.com/derailed/popeye) | Scans live Kubernetes cluster and reports potential issues with deployed resources and configurations. |
| [porter](https://github.com/getporter/porter) | With Porter you can package your application artifact, tools, etc. as a bundle that can distribute and install. |
| [promtool](https://github.com/prometheus/prometheus) | Prometheus rule tester and debugging utility |
| [regctl](https://github.com/regclient/regclient) | Utility for accessing docker registries |
| [rekor-cli](https://github.com/sigstore/rekor) | Secure Supply Chain - Transparency Log |
| [replicated](https://github.com/replicatedhq/replicated) | CLI for interacting with the Replicated Vendor API |
| [rpk](https://github.com/redpanda-data/redpanda) | Kafka compatible streaming platform for mission critical workloads. |
Expand All @@ -892,7 +893,6 @@ There are 56 apps that you can install on your cluster.
| [task](https://github.com/go-task/task) | A simple task runner and build tool |
| [tctl](https://github.com/temporalio/tctl) | Temporal CLI. |
| [terraform](https://github.com/hashicorp/terraform) | Infrastructure as Code for major cloud providers. |
| [opentofu](https://github.com/opentofu/opentofu) | OpenTofu lets you declaratively manage your cloud infrastructure. |
| [terraform-docs](https://github.com/terraform-docs/terraform-docs) | Generate documentation from Terraform modules in various output formats. |
| [terragrunt](https://github.com/gruntwork-io/terragrunt) | Terragrunt is a thin wrapper for Terraform that provides extra tools for working with multiple Terraform modules |
| [terrascan](https://github.com/tenable/terrascan) | Detect compliance and security violations across Infrastructure as Code. |
Expand All @@ -901,6 +901,7 @@ There are 56 apps that you can install on your cluster.
| [tilt](https://github.com/tilt-dev/tilt) | A multi-service dev environment for teams on Kubernetes. |
| [timoni](https://github.com/stefanprodan/timoni) | A package manager for Kubernetes powered by CUE. |
| [tkn](https://github.com/tektoncd/cli) | A CLI for interacting with Tekton. |
| [tofu](https://github.com/opentofu/opentofu) | OpenTofu lets you declaratively manage your cloud infrastructure |
| [trivy](https://github.com/aquasecurity/trivy) | Vulnerability Scanner for Containers and other Artifacts, Suitable for CI. |
| [vagrant](https://github.com/hashicorp/vagrant) | Tool for building and distributing development environments. |
| [vault](https://github.com/hashicorp/vault) | A tool for secrets management, encryption as a service, and privileged access management. |
Expand All @@ -910,6 +911,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 146 tools, use `arkade get NAME` to download one.
There are 151 tools, use `arkade get NAME` to download one.

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

func Test_DownloadRegCtl(t *testing.T) {
tools := MakeTools()
name := "regctl"
const version = "v0.5.7"

tool := getTool(name, tools)

tests := []test{
{
os: "ming",
arch: arch64bit,
version: version,
url: `https://github.com/regclient/regclient/releases/download/v0.5.7/regctl-windows-amd64.exe`,
},
{
os: "linux",
arch: arch64bit,
version: version,
url: `https://github.com/regclient/regclient/releases/download/v0.5.7/regctl-linux-amd64`,
},
{
os: "linux",
arch: archARM64,
version: version,
url: `https://github.com/regclient/regclient/releases/download/v0.5.7/regctl-linux-arm64`,
},
{
os: "darwin",
arch: arch64bit,
version: version,
url: `https://github.com/regclient/regclient/releases/download/v0.5.7/regctl-darwin-amd64`,
},
{
os: "darwin",
arch: archDarwinARM64,
version: version,
url: `https://github.com/regclient/regclient/releases/download/v0.5.7/regctl-darwin-arm64`,
},
}
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)
}
}
}
28 changes: 28 additions & 0 deletions pkg/get/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -4118,5 +4118,33 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Repo}}
gptscript-{{.Version}}-{{$os}}-{{$arch}}.{{$ext}}
`,
})

tools = append(tools,
Tool{
Owner: "regclient",
Repo: "regclient",
Name: "regctl",
Description: "Utility for accessing docker registries",
BinaryTemplate: `
{{ $os := .OS }}
{{ $arch := .Arch }}
{{ $ext := "" }}
{{- if eq .Arch "aarch64" -}}
{{$arch = "arm64"}}
{{- else if eq .Arch "arm64" -}}
{{ $arch = "arm64" }}
{{- else if eq .Arch "x86_64" -}}
{{ $arch = "amd64" }}
{{- end -}}
{{ if HasPrefix .OS "ming" -}}
{{$os = "windows"}}
{{$ext = ".exe"}}
{{- end -}}
regctl-{{$os}}-{{$arch}}{{$ext}}
`,
})
return tools
}

0 comments on commit 6cf4a64

Please sign in to comment.