Skip to content

bug: tool name sanitization #2204

@mgrechukh

Description

@mgrechukh

Describe the Bug

In pre-0.16.0 shell implementation, tool name consisting of multiple words separated by dash were sanitized as environment variable. I.e. for "teleport-community" plugin we expect "ASDF_TELEPORT_COMMUNITY_VERSION".

As now toolName passed uppercased but otherwise unmodified, it now awaits "ASDF_TELEPORT-COMMUNITY_VERSION" variable which can not be simply set in shell. It breaks certain automated usage scenarios.

Here's the proposed fix: #2194

Steps to Reproduce

  1. export ASDF_TELEPORT_COMMUNITY_VERSION=14.3.4
  2. asdf exec tsh version

Expected Behaviour

❯ asdf exec tsh version
Teleport v14.3.4 git:v14.3.4-0-g16b0227 go1.21.6

Actual Behaviour

❯ asdf exec tsh version
Teleport v9.3.26 git:api/v9.3.26-0-ga7c726f670 go1.17.11

Environment

OS:
Darwin LMAC-9J96M1Q-EU 25.0.0 Darwin Kernel Version 25.0.0: Wed Sep 17 21:38:03 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T8112 arm64 arm Darwin

SHELL:
GNU bash, version 5.2.32(1)-release (aarch64-apple-darwin23.4.0)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

BASH VERSION:
5.2.32(1)-release

ASDF VERSION:
0.18.0 (revision unknown)

ASDF INTERNAL VARIABLES:
ASDF_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/Users/MGV2/.asdf
ASDF_CONFIG_FILE=/Users/MGV2/.asdfrc

ASDF INSTALLED PLUGINS:
 cfssl              https://github.com/mathew-fleisch/asdf-cfssl.git
                   56fc8469ba5b9159a0094b00a430006a1bbe5914
cilium-cli         https://github.com/carnei-ro/asdf-cilium-cli.git
                   89c77118e8a28fa188d87681a5ee9c6dc1a8295b
cilium-hubble      https://github.com/NitriKx/asdf-cilium-hubble.git
                   66a57b317a8b7d75c9f5e6c2af5db3a0db7c8dfd
cmctl              https://github.com/asdf-community/asdf-cmctl.git
                   6dd57098a2b0ed22d4bf5e88ee61eee68e626396
etcd               https://github.com/particledecay/asdf-etcd.git
                   8a29f94778e0b204f5ad9a1cdf4c810999410d22
flux2              https://github.com/tablexi/asdf-flux2.git
                   771755e66120e95626ec798d26bcd473aca93795
fluxctl            https://github.com/stefansedich/asdf-fluxctl.git
                   c2ecce088cb4c00d1bf40732520b5abc5aed66a8
fzf                https://github.com/kompiro/asdf-fzf
                   d19eb6792cbad50f0d69c78a270ebe5a76b91178
gcloud             https://github.com/jthegedus/asdf-gcloud.git
                   a642c36ecda152b9994b797311765b1b5db8e2a6
glab               https://github.com/particledecay/asdf-glab.git
                   2c081ae0d1fa02786326bc499ec61bbc3b43f20f
helm               https://github.com/Antiarchitect/asdf-helm.git
                   a39e17b098523b3840c359055192751ae835f835
jq                 https://github.com/lsanwick/asdf-jq.git
                   addae5118090263aa43ca9eb998b250b10c7d2dd
k9s                https://github.com/looztra/asdf-k9s.git
                   2b3af8795e23f3822abc4c11fdbce0d683da76db
kubectl            https://github.com/asdf-community/asdf-kubectl.git
                   cbe6df49865a52ad5e6e430dff33f474785ff2bf
kubeseal           https://github.com/stefansedich/asdf-kubeseal.git
                   67e7c0dfc37fed4a90068c414fd8168a8d46b8d0
linkerd            https://github.com/KazW/asdf-linkerd.git
                   925ae7c3b02b5f97199a4f71393a96c97fb290da
mc                 https://github.com/penpyt/asdf-mc.git
                   b0458cf1e89970215da39a9ffa4952ddd5212359
opentofu           https://github.com/defenseunicorns/asdf-opentofu.git
                   bd2c261dfea8bac096876637ff1e41f39c0632bc
packer             https://github.com/asdf-community/asdf-hashicorp.git
                   f1602b610105c6848c79eb95f2a833ecb48a973e
python             https://github.com/danhper/asdf-python.git
                   5e277e24ec2b6739728f458c1c25eeb2a8b8bb79
rclone             https://github.com/johnlayton/asdf-rclone.git
                   6a87924297fbafcc2d595c24ee200cb3ca477d46
skopeo             https://github.com/kheino/asdf-skopeo
                   89863f3025f14bb6a48db2533b65fa1d24128ab9
sonarscanner       https://github.com/virtualstaticvoid/asdf-sonarscanner.git
                   c42dd95997cc033d7e4a4481b7a0a9ec79e4b3f1
sops               https://github.com/feniix/asdf-sops.git
                   5c7a2fbb26b3c7c34f7cd5befd15e982ddff1b28
teleport-community https://github.com/MaloPolese/asdf-teleport-community
                   c3e0cb3889b78a512183278ce3c0af4b425d7a61
terraform          https://github.com/asdf-community/asdf-hashicorp.git
                   197e3ec0f0d6adb96f93411ed3ed5cf47c77a5e0
vault              https://github.com/asdf-community/asdf-hashicorp.git
                   f1602b610105c6848c79eb95f2a833ecb48a973e

asdf plugins affected (if relevant)

teleport-community
cilium-cli
cilium-hubble

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions