Skip to content

Commit 2495879

Browse files
Reverting get_previous_version logic to get the first tag_name's value from json (devcontainers#902)
* changes as requested * changes acc. to comments
1 parent 5ad3f6f commit 2495879

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/kubectl-helm-minikube/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "kubectl-helm-minikube",
3-
"version": "1.1.7",
3+
"version": "1.1.8",
44
"name": "Kubectl, Helm, and Minikube",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/kubectl-helm-minikube",
66
"description": "Installs latest version of kubectl, Helm, and optionally minikube. Auto-detects latest versions and installs needed dependencies.",

src/kubectl-helm-minikube/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ fi
158158
# Function to fetch the version released prior to the latest version
159159
get_previous_version() {
160160
repo_url=$1
161-
# this would del the assets key and then get the second encountered tag_name's value from the filtered array of objects
162-
curl -s "$repo_url" | jq -r 'del(.[].assets) | .[1].tag_name'
161+
# this would del the assets key and then get the first encountered tag_name's value from the filtered array of objects
162+
curl -s "$repo_url" | jq -r 'del(.[].assets) | .[0].tag_name'
163163
}
164164

165165
get_helm() {

test/docker-in-docker/docker_build_fallback_buildx.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ get_latest_version() {
2626

2727
# Function to fetch the previous version of the plugin
2828
get_previous_version() {
29-
curl -s "$repo_url" | jq -r 'del(.[].assets) | .[1].tag_name' # this would del the assets key and then get the second encountered tag_name's value from the filtered array of objects
29+
# this would del the assets key and then get the first encountered tag_name's value from the filtered array of objects
30+
curl -s "$repo_url" | jq -r 'del(.[].assets) | .[0].tag_name'
3031
}
3132

3233
# Function to change the patch number in a semver version

test/kubectl-helm-minikube/install_only_helm_fallback.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ change_patch_number() {
5757
# Function to fetch the previous version of the plugin
5858
get_previous_version() {
5959
# this would del the assets key and then get the second encountered tag_name's value from the filtered array of objects
60-
curl -s "$repo_url" | jq -r 'del(.[].assets) | .[1].tag_name'
60+
curl -s "$repo_url" | jq -r 'del(.[].assets) | .[0].tag_name'
6161
}
6262

6363
get_helm() {

0 commit comments

Comments
 (0)