Skip to content

Commit

Permalink
Update argument names (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
lasuillard authored Nov 19, 2024
1 parent 7e0c125 commit ce6ede2
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default_stages: [commit]
default_stages: [pre-commit]
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
8 changes: 4 additions & 4 deletions src/kubernetes-tools/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "Kubernetes Tools",
"id": "kubernetes-tools",
"version": "0.2.0",
"version": "0.3.0",
"description": "A feature to install K8s tools.",
"options": {
"kubectl-version": {
"type": "string",
"default": "latest",
"description": "The version of kubectl to install, in format of 'v*'."
},
"install-krew": {
"krew-version": {
"type": "string",
"proposals": [
"latest",
Expand All @@ -18,7 +18,7 @@
"default": "none",
"description": "Whether to install Krew. Use 'latest' to install the latest version. Use 'none' to skip installation."
},
"install-k9s": {
"k9s-version": {
"type": "string",
"proposals": [
"latest",
Expand All @@ -27,7 +27,7 @@
"default": "none",
"description": "Whether to install k9s. Use 'latest' to install the latest version. Use 'none' to skip installation."
},
"install-helm": {
"helm-version": {
"type": "string",
"proposals": [
"latest",
Expand Down
20 changes: 10 additions & 10 deletions src/kubernetes-tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ curl -L --output /usr/bin/kubectl "https://dl.k8s.io/release/${KUBECTL_VERSION}/

# Krew
# ----------------------------------------------------------------------------
if [ "$INSTALL_KREW" != "none" ]; then
if [ "$INSTALL_KREW" = "latest" ]; then
if [ "$KREW_VERSION" != "none" ]; then
if [ "$KREW_VERSION" = "latest" ]; then
krew_dl_url="$(
curl -s https://api.github.com/repos/kubernetes-sigs/krew/releases/latest |
grep -Eo -m 1 "https://.+krew-linux_${ARCH}\.tar\.gz"
)"
else
krew_dl_url="https://github.com/kubernetes-sigs/krew/releases/download/${INSTALL_KREW}/krew-linux_${ARCH}.tar.gz"
krew_dl_url="https://github.com/kubernetes-sigs/krew/releases/download/${KREW_VERSION}/krew-linux_${ARCH}.tar.gz"
fi

echo "Installing Krew from $krew_dl_url"
Expand All @@ -47,14 +47,14 @@ fi

# K9s
# ----------------------------------------------------------------------------
if [ "$INSTALL_K9S" != "none" ]; then
if [ "$INSTALL_K9S" = "latest" ]; then
if [ "$K9S_VERSION" != "none" ]; then
if [ "$K9S_VERSION" = "latest" ]; then
k9s_dl_url="$(
curl -s https://api.github.com/repos/derailed/k9s/releases/latest |
grep -Eo -m 1 "https://.+k9s_linux_${ARCH}\.deb"
)"
else
k9s_dl_url="https://github.com/derailed/k9s/releases/download/${INSTALL_K9S}/k9s_linux_${ARCH}.deb"
k9s_dl_url="https://github.com/derailed/k9s/releases/download/${K9S_VERSION}/k9s_linux_${ARCH}.deb"
fi

echo "Downloading K9s from $k9s_dl_url"
Expand All @@ -65,10 +65,10 @@ fi

# Helm
# ----------------------------------------------------------------------------
if [ "$INSTALL_HELM" != "none" ]; then
helm_version=$([ "$INSTALL_HELM" = "latest" ] && echo '' || echo "$INSTALL_HELM")
if [ "$HELM_VERSION" != "none" ]; then
HELM_VERSION=$([ "$HELM_VERSION" = "latest" ] && echo '' || echo "$HELM_VERSION")

echo "Installing Helm $helm_version"
echo "Installing Helm $HELM_VERSION"
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 |
DESIRED_VERSION="$helm_version" bash
DESIRED_VERSION="$HELM_VERSION" bash
fi
6 changes: 3 additions & 3 deletions src/opentofu/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "OpenTofu",
"id": "opentofu",
"version": "0.2.1",
"version": "0.3.0",
"description": "A feature to install OpenTofu and relevant tools.",
"options": {
"opentofu-version": {
Expand All @@ -14,7 +14,7 @@
"default": false,
"description": "Whether to create symlink `terraform` to `tofu`."
},
"install-terragrunt": {
"terragrunt-version": {
"type": "string",
"proposals": [
"latest",
Expand All @@ -23,7 +23,7 @@
"default": "none",
"description": "Whether to install Terragrunt. Use 'latest' to install the latest version. Use 'none' to skip installation."
},
"install-terraform-docs": {
"terraform-docs-version": {
"type": "string",
"proposals": [
"latest",
Expand Down
12 changes: 6 additions & 6 deletions src/opentofu/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.

# Terragrunt
# ----------------------------------------------------------------------------
if [ "$INSTALL_TERRAGRUNT" != "none" ]; then
if [ "$INSTALL_TERRAGRUNT" = "latest" ]; then
if [ "$TERRAGRUNT_VERSION" != "none" ]; then
if [ "$TERRAGRUNT_VERSION" = "latest" ]; then
terragrunt_dl_url="$(
curl -s https://api.github.com/repos/gruntwork-io/terragrunt/releases/latest |
grep -Eo -m 1 "https://.+?terragrunt_linux_${ARCH}"
)"
else
terragrunt_dl_url="https://github.com/gruntwork-io/terragrunt/releases/download/v${INSTALL_TERRAGRUNT}/terragrunt_linux_${ARCH}"
terragrunt_dl_url="https://github.com/gruntwork-io/terragrunt/releases/download/v${TERRAGRUNT_VERSION}/terragrunt_linux_${ARCH}"
fi

echo "Downloading Terragrunt from $terragrunt_dl_url"
Expand All @@ -34,14 +34,14 @@ fi

# terraform-docs
# ----------------------------------------------------------------------------
if [ "$INSTALL_TERRAFORM_DOCS" != "none" ]; then
if [ "$INSTALL_TERRAFORM_DOCS" = "latest" ]; then
if [ "$TERRAFORM_DOCS_VERSION" != "none" ]; then
if [ "$TERRAFORM_DOCS_VERSION" = "latest" ]; then
tfdocs_dl_url="$(
curl -s https://api.github.com/repos/terraform-docs/terraform-docs/releases/latest |
grep -Eo -m 1 "https://.+?terraform-docs-v.+-linux-${ARCH}\.tar\.gz"
)"
else
tfdocs_dl_url="https://github.com/terraform-docs/terraform-docs/releases/download/v${INSTALL_TERRAFORM_DOCS}/terraform-docs-v${INSTALL_TERRAFORM_DOCS}-linux-${ARCH}.tar.gz"
tfdocs_dl_url="https://github.com/terraform-docs/terraform-docs/releases/download/v${TERRAFORM_DOCS_VERSION}/terraform-docs-v${TERRAFORM_DOCS_VERSION}-linux-${ARCH}.tar.gz"
fi

echo "Downloading terraform-docs from $tfdocs_dl_url"
Expand Down
12 changes: 6 additions & 6 deletions test/kubernetes-tools/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"features": {
"kubernetes-tools": {
"kubectl-version": "latest",
"install-krew": "latest",
"install-k9s": "latest",
"install-helm": "latest"
"krew-version": "latest",
"k9s-version": "latest",
"helm-version": "latest"
}
}
},
Expand All @@ -15,9 +15,9 @@
"features": {
"kubernetes-tools": {
"kubectl-version": "v1.31.1",
"install-krew": "v0.4.3",
"install-k9s": "v0.32.4",
"install-helm": "v3.16.2"
"krew-version": "v0.4.3",
"k9s-version": "v0.32.4",
"helm-version": "v3.16.2"
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions test/opentofu/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"opentofu": {
"opentofu-version": "latest",
"terraform-is-tofu": true,
"install-terragrunt": "latest",
"install-terraform-docs": "latest"
"terragrunt-version": "latest",
"terraform-docs-version": "latest"
}
}
},
Expand All @@ -15,8 +15,8 @@
"features": {
"opentofu": {
"opentofu-version": "1.7.3",
"install-terragrunt": "0.67.13",
"install-terraform-docs": "0.18.0"
"terragrunt-version": "0.67.13",
"terraform-docs-version": "0.18.0"
}
}
}
Expand Down

0 comments on commit ce6ede2

Please sign in to comment.