Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/kubectl-helm-minikube/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "kubectl-helm-minikube",
"version": "1.2.1",
"version": "1.2.2",
"name": "Kubectl, Helm, and Minikube",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/kubectl-helm-minikube",
"description": "Installs latest version of kubectl, Helm, and optionally minikube. Auto-detects latest versions and installs needed dependencies.",
Expand Down
3 changes: 2 additions & 1 deletion src/kubectl-helm-minikube/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ fi
find_version_from_git_tags() {
local variable_name=$1
local requested_version=${!variable_name}
requested_version="${requested_version#v}"
if [ "${requested_version}" = "none" ]; then return; fi
local repository=$2
local prefix=${3:-"tags/v"}
local separator=${4:-"."}
local last_part_optional=${5:-"false"}
local last_part_optional=${5:-"false"}
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
local escaped_separator=${separator//./\\.}
local last_part
Expand Down
33 changes: 33 additions & 0 deletions test/kubectl-helm-minikube/install_kubectl_with_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
set -e

# Optional: Import test library
source dev-container-features-test-lib

# Define expected versions
KUBECTL_EXPECTED_VERSION="v1.33.0"
HELM_VERSION="v3.17.3"
MINIKUBE_VERSION="v1.31.1"

set +e
kubectl version --client --output json | jq -r '.clientVersion.gitVersion' | grep "${KUBECTL_VERSION}"
exit_code=$?
check "kubectl-version-${KUBECTL_VERSION}-installed" bash -c "echo ${exit_code} | grep 0"
echo "kubectl version:"
kubectl version --client

helm version --short | grep "${HELM_VERSION}"
exit_code=$?
check "helm-version-${HELM_VERSION}-installed" bash -c "echo ${exit_code} | grep 0"
echo "helm version:"
helm version --short

minikube version --short | grep "${MINIKUBE_VERSION}"
exit_code=$?
check "minikube-version-${MINIKUBE_VERSION}-installed" bash -c "echo ${exit_code} | grep 0"
echo "minikube version:"
minikube version --short
set -e

# Report result
reportResults
33 changes: 33 additions & 0 deletions test/kubectl-helm-minikube/install_kubectl_without_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
set -e

# Optional: Import test library
source dev-container-features-test-lib

# Define expected versions
KUBECTL_EXPECTED_VERSION="1.30"
HELM_VERSION="3.16"
MINIKUBE_VERSION="1.28"

set +e
kubectl version --client --output json | jq -r '.clientVersion.gitVersion' | grep "${KUBECTL_VERSION}"
exit_code=$?
check "kubectl-version-${KUBECTL_VERSION}-installed" bash -c "echo ${exit_code} | grep 0"
echo "kubectl version:"
kubectl version --client

helm version --short | grep "${HELM_VERSION}"
exit_code=$?
check "helm-version-${HELM_VERSION}-installed" bash -c "echo ${exit_code} | grep 0"
echo "helm version:"
helm version --short

minikube version --short | grep "${MINIKUBE_VERSION}"
exit_code=$?
check "minikube-version-${MINIKUBE_VERSION}-installed" bash -c "echo ${exit_code} | grep 0"
echo "minikube version:"
minikube version --short
set -e

# Report result
reportResults
22 changes: 21 additions & 1 deletion test/kubectl-helm-minikube/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,25 @@
"minikube": "none"
}
}
},
"install_kubectl_without_version": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"kubectl-helm-minikube": {
"version": "1.30",
"helm": "3.16",
"minikube": "1.28"
}
}
},
"install_kubectl_with_version": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"kubectl-helm-minikube": {
"version": "v1.33.0",
"helm": "v3.17.3",
"minikube": "v1.31.1"
}
}
}
}
}