Tfenv: Problème avec TFENV_AUTO_INSTALL et le plus récent :<regex>syntaxe</regex>

Créé le 6 oct. 2020  ·  2Commentaires  ·  Source: tfutils/tfenv

Lorsque vous naviguez dans le répertoire avec un fichier .terraform-version avec ce contenu : latest:^0.13 il ne s'installe pas automatiquement correctement. A la place j'obtiens ceci :

[mpescetto:~/test/test2]$ export TFENV_DEBUG=2
[mpescetto:~/test/test2]$ terraform -version
[DEBUG] Sourcing helpers from /usr/local/Cellar/tfenv/2.0.0/lib/helpers.sh
/usr/local/bin/terraform: DEBUG trap set
/usr/local/bin/terraform: Helpers sourced successfully
/usr/local/bin/terraform: $PATH does not contain '/usr/local/Cellar/tfenv/2.0.0/libexec', prepending and exporting it now
/usr/local/bin/terraform: $PATH does not contain '/usr/local/Cellar/tfenv/2.0.0/bin', prepending and exporting it now
/usr/local/bin/terraform: program="terraform"
/usr/local/bin/terraform: Exec: "/usr/local/Cellar/tfenv/2.0.0/bin/tfenv" exec "-version"
/usr/local/Cellar/tfenv/2.0.0/bin/tfenv: TFENV_HELPERS is set, not sourcing helpers again
/usr/local/Cellar/tfenv/2.0.0/bin/tfenv: $PATH already contains '/usr/local/Cellar/tfenv/2.0.0/libexec', not adding it again
/usr/local/Cellar/tfenv/2.0.0/bin/tfenv: $PATH already contains '/usr/local/Cellar/tfenv/2.0.0/bin', not adding it again
/usr/local/Cellar/tfenv/2.0.0/bin/tfenv: Setting TFENV_DIR to /Users/mpescetto/test/test2
/usr/local/Cellar/tfenv/2.0.0/bin/tfenv: tfenv argument is: exec
/usr/local/Cellar/tfenv/2.0.0/bin/tfenv: Long argument provided: exec
/usr/local/Cellar/tfenv/2.0.0/bin/tfenv: Resulting command-path: /usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-exec
/usr/local/Cellar/tfenv/2.0.0/bin/tfenv: Exec: "/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-exec" "-version"
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-exec: TFENV_HELPERS is set, not sourcing helpers again
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-exec: $PATH already contains '/usr/local/Cellar/tfenv/2.0.0/libexec', not adding it again
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-exec: $PATH already contains '/usr/local/Cellar/tfenv/2.0.0/bin', not adding it again
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-exec: Getting version from tfenv-version-name
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-version-name: TFENV_HELPERS is set, not sourcing helpers again
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-version-name: $PATH already contains '/usr/local/Cellar/tfenv/2.0.0/libexec', not adding it again
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-version-name: $PATH already contains '/usr/local/Cellar/tfenv/2.0.0/bin', not adding it again
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-version-file: TFENV_HELPERS is set, not sourcing helpers again
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-version-file: $PATH already contains '/usr/local/Cellar/tfenv/2.0.0/libexec', not adding it again
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-version-file: $PATH already contains '/usr/local/Cellar/tfenv/2.0.0/bin', not adding it again
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-version-file: Looking for a version file in /Users/mpescetto/test/test2
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-version-file: Found at /Users/mpescetto/test/test2/.terraform-version
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-version-name: TFENV_VERSION_FILE retrieved from tfenv-version-file: /Users/mpescetto/test/test2/.terraform-version
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-version-name: TFENV_VERSION specified in TFENV_VERSION_FILE: latest:^0.13
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-version-name: TFENV_VERSION uses 'latest' keyword: latest:^0.13
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-version-name: 'latest' keyword uses regex: ^0.13
/usr/local/Cellar/tfenv/2.0.0/libexec/tfenv-version-name: No installed versions of terraform matched 'latest:^0.13'
Here's a shell for debugging the current environment. 'exit 0' to resume script from here. Non-zero exit code will abort - parent shell will terminate.

Même essayer de lister avec ceci échoue:

[mpescetto:~/test/test2]$ tfenv list
No installed versions of terraform matched 'latest:^0.13'
tfenv-version-name failed

mais si je fais juste le tfenv install il s'installe correctement :

[mpescetto:~/test/test2]$ tfenv install
Installing Terraform v0.13.4
Downloading release tarball from https://releases.hashicorp.com/terraform/0.13.4/terraform_0.13.4_darwin_amd64.zip
######################################################################## 100.0%
Downloading SHA hash file from https://releases.hashicorp.com/terraform/0.13.4/terraform_0.13.4_SHA256SUMS
No keybase install found, skipping OpenPGP signature verification
Archive:  tfenv_download.33M9Ak/terraform_0.13.4_darwin_amd64.zip
  inflating: /usr/local/Cellar/tfenv/2.0.0/versions/0.13.4/terraform
Installation of terraform v0.13.4 successful. To make this your default version, run 'tfenv use 0.13.4'

Donc je ne sais pas pourquoi ça échoue. Je ferais mieux de mystère pour y jeter un œil.

bug

Commentaire le plus utile

Quelque chose ne va pas avec le mot clé "dernier".
Lorsque j'essaie de reproduire votre cas d'utilisation, le résultat est différent (car un 0.13.x est également installé)

❯ tfenv --version
tfenv 2.0.0-37-g0494129
❯ cat .terraform-version
latest:^0.13

Voir les versions installées

❯ tfenv list
* 0.13.5 (set by /home/hugosalesses/workspace/private/terraform-examples/.terraform-version)
  0.12.30
  0.11.14

Hum ! 0.13.5 est la dernière version 0.13 installée mais pas la dernière 0.13 (0.13.6)
Et l'exécution terraform montre la même mauvaise version

❯ terraform version
Terraform v0.13.5

Your version of Terraform is out of date! The latest version
is 0.14.5. You can update by downloading from https://www.terraform.io/downloads.html

Je pense que quelque chose doit être corrigé avec le dernier mot clé.

Tous les 2 commentaires

Quelque chose ne va pas avec le mot clé "dernier".
Lorsque j'essaie de reproduire votre cas d'utilisation, le résultat est différent (car un 0.13.x est également installé)

❯ tfenv --version
tfenv 2.0.0-37-g0494129
❯ cat .terraform-version
latest:^0.13

Voir les versions installées

❯ tfenv list
* 0.13.5 (set by /home/hugosalesses/workspace/private/terraform-examples/.terraform-version)
  0.12.30
  0.11.14

Hum ! 0.13.5 est la dernière version 0.13 installée mais pas la dernière 0.13 (0.13.6)
Et l'exécution terraform montre la même mauvaise version

❯ terraform version
Terraform v0.13.5

Your version of Terraform is out of date! The latest version
is 0.14.5. You can update by downloading from https://www.terraform.io/downloads.html

Je pense que quelque chose doit être corrigé avec le dernier mot clé.

je suis d'accord
```bash
$ TFENV_TERRAFORM_VERSION=dernière : ^0.12 version exécutable de tfenv
Aucune version installée de terraform ne correspond à 'latest:^0.12'
$ TFENV_TERRAFORM_VERSION=0.12.30 tfenv version exécutable
la version '0.12.30' n'est pas installée (définie par TFENV_TERRAFORM_VERSION). Installation maintenant en tant que TFENV_AUTO_INSTALL==true
Installation de Terraform v0.12.30
Téléchargement de la version tarball depuis https://releases.hashicorp.com/terraform/0.12.30/terraform_0.12.30_linux_amd64.zip

##################################################### ################ 100,0%

Téléchargement du fichier de hachage SHA à partir de https://releases.hashicorp.com/terraform/0.12.30/terraform_0.12.30_SHA256SUMS
Aucune installation de base de clé trouvée, ignorant la vérification de la signature OpenPGP
Archive : tfenv_download.nwfk3i/terraform_0.12.30_linux_amd64.zip
gonflage : /root/.tfenv/versions/0.12.30/terraform
Installation de Terraform v0.12.30 réussie. Pour en faire votre version par défaut, exécutez 'tfenv use 0.12.30'
Terraform v0.12.30

Votre version de Terraform est obsolète ! La dernière version
est 0,14.9. Vous pouvez mettre à jour en téléchargeant à partir de https://www.terraform.io/downloads.html ```

Cette page vous a été utile?
0 / 5 - 0 notes

Questions connexes

nitrocode picture nitrocode  ·  4Commentaires

ibakayoko picture ibakayoko  ·  6Commentaires

sthristov picture sthristov  ·  5Commentaires

alexppg picture alexppg  ·  4Commentaires

itsSaad picture itsSaad  ·  6Commentaires