ivoronin / packer-plugin-sshkey

Packer plugin used to generate SSH keys.
16 stars 10 forks source link

Version mismatch #64

Open h3x3d opened 6 months ago

h3x3d commented 6 months ago

Version mismatch on packer build

$ packer init alt-linux.pkr.hcl
2024/03/12 15:53:03 [INFO] Packer version: 1.11.0-alpha [go1.21.8 linux amd64]
2024/03/12 15:53:03 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/03/12 15:53:03 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/03/12 15:53:03 [WARN] Config file doesn't exist: /root/.packerconfig
2024/03/12 15:53:03 [INFO] Setting cache directory: /root/.cache/packer
e: Running in background, not using a TTY
2024/03/12 15:53:03 [TRACE] init: plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc0006f0080)}}, ReleasesOnly:false}}
2024/03/12 15:53:03 [TRACE] listing potential installations for "github.com/ivoronin/sshkey" that match ">= 1.0.1". plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc0006f0080)}}, ReleasesOnly:false}}
2024/03/12 15:53:03 [TRACE] getting available versions for the github.com/ivoronin/sshkey plugin
2024/03/12 15:53:03 [WARNING] github-getter: no GitHub token set, if you intend to install plugins often, please set the PACKER_GITHUB_API_TOKEN env var
2024/03/12 15:53:03 [DEBUG] github-getter: getting "https://api.github.com/repos/ivoronin/packer-plugin-sshkey/git/matching-refs/tags"
2024/03/12 15:53:03 [DEBUG] will try to install: [1.2.0 1.1.0 1.0.9 1.0.8 1.0.3 1.0.2 1.0.1]
2024/03/12 15:53:03 [TRACE] fetching checksums file for the "1.2.0" version of the github.com/ivoronin/sshkey plugin in "/root/.config/packer/plugins/github.com/ivoronin/sshkey"...
2024/03/12 15:53:03 [DEBUG] github-getter: getting "https://github.com/ivoronin/packer-plugin-sshkey/releases/download/v1.2.0/packer-plugin-sshkey_v1.2.0_SHA256SUMS"
2024/03/12 15:53:04 [TRACE] failed requesting: *github.ErrorResponse. GET https://github.com/ivoronin/packer-plugin-sshkey/releases/download/v1.2.0/packer-plugin-sshkey_v1.2.0_SHA256SUMS: 404  []
2024/03/12 15:53:04 [TRACE] could not get sha256 checksum file for github.com/ivoronin/sshkey version 1.2.0. Is the file present on the release and correctly named ? GET https://github.com/ivoronin/packer-plugin-sshkey/releases/download/v1.2.0/packer-plugin-sshkey_v1.2.0_SHA256SUMS: 404  []
2024/03/12 15:53:04 [TRACE] fetching checksums file for the "1.1.0" version of the github.com/ivoronin/sshkey plugin in "/root/.config/packer/plugins/github.com/ivoronin/sshkey"...
2024/03/12 15:53:04 [DEBUG] github-getter: getting "https://github.com/ivoronin/packer-plugin-sshkey/releases/download/v1.1.0/packer-plugin-sshkey_v1.1.0_SHA256SUMS"
2024/03/12 15:53:05 [TRACE] ignoring invalid remote binary packer-plugin-sshkey_v1.1.0_x5.0_darwin_arm64.zip: wrong system, expected linux_amd64 
2024/03/12 15:53:05 [TRACE] ignoring invalid remote binary packer-plugin-sshkey_v1.1.0_x5.0_darwin_amd64.zip: wrong system, expected linux_amd64 
2024/03/12 15:53:05 [TRACE] ignoring invalid remote binary packer-plugin-sshkey_v1.1.0_x5.0_windows_amd64.zip: wrong system, expected linux_amd64 
2024/03/12 15:53:05 [TRACE] ignoring invalid remote binary packer-plugin-sshkey_v1.1.0_x5.0_freebsd_amd64.zip: wrong system, expected linux_amd64 
2024/03/12 15:53:05 [TRACE] ignoring invalid remote binary packer-plugin-sshkey_v1.1.0_x5.0_linux_arm.zip: wrong system, expected linux_amd64 
2024/03/12 15:53:05 [TRACE] ignoring invalid remote binary packer-plugin-sshkey_v1.1.0_x5.0_windows_arm64.zip: wrong system, expected linux_amd64 
2024/03/12 15:53:05 [TRACE] ignoring invalid remote binary packer-plugin-sshkey_v1.1.0_x5.0_freebsd_arm64.zip: wrong system, expected linux_amd64 
2024/03/12 15:53:05 [TRACE] About to get: packer-plugin-sshkey_v1.1.0_x5.0_linux_amd64.zip
2024/03/12 15:53:05 [DEBUG] github-getter: getting "https://github.com/ivoronin/packer-plugin-sshkey/releases/download/v1.1.0/packer-plugin-sshkey_v1.1.0_x5.0_linux_amd64.zip"
2024/03/12 15:53:07 [INFO] (telemetry) Finalizing.
Installed plugin github.com/ivoronin/sshkey v1.1.0 in "/root/.config/packer/plugins/github.com/ivoronin/sshkey/packer-plugin-sshkey_v1.1.0_x5.0_linux_amd64"
2024/03/12 15:53:07 waiting for all plugin processes to complete...

$ packer build alt-linux.pkr.hcl
2024/03/12 15:53:07 [INFO] Packer version: 1.11.0-alpha [go1.21.8 linux amd64]
2024/03/12 15:53:07 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/03/12 15:53:07 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/03/12 15:53:07 [WARN] Config file doesn't exist: /root/.packerconfig
2024/03/12 15:53:07 [INFO] Setting cache directory: /root/.cache/packer
e: Running in background, not using a TTY
2024/03/12 15:53:07 [TRACE] listing potential installations for <nil> that match "". plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000134180)}}, ReleasesOnly:false}}
2024/03/12 15:53:07 plugin "/root/.config/packer/plugins/github.com/ivoronin/sshkey/packer-plugin-sshkey_v1.1.0_x5.0_linux_amd64" reported version 1.0.1 while its name implies version 1.1.0, ignoring
2024/03/12 15:53:07 [INFO] found external [-packer-default-plugin-name-] builders from qemu plugin
2024/03/12 15:53:07 [TRACE] listing potential installations for "github.com/ivoronin/sshkey" that match ">= 1.0.1". plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000abae80)}}, ReleasesOnly:false}}
2024/03/12 15:53:07 plugin "/root/.config/packer/plugins/github.com/ivoronin/sshkey/packer-plugin-sshkey_v1.1.0_x5.0_linux_amd64" reported version 1.0.1 while its name implies version 1.1.0, ignoring
Error: Missing plugins
The following plugins are required, but not installed:
* github.com/ivoronin/sshkey >= 1.1.0
Did you run packer init for this project ?
baizon commented 3 months ago

Made a pull request to fix it: https://github.com/ivoronin/packer-plugin-sshkey/pull/66

bigpick commented 3 months ago

Looks like it got merged, but still complains about a mismatch bc a new 1.2.0 release hasn't been cut yet?

bigpick commented 3 months ago
Installed plugin github.com/hashicorp/qemu v1.1.0 in ".../packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64"
Installed plugin github.com/hashicorp/ansible v1.1.1 in ".../packer/plugins/github.com/hashicorp/ansible/packer-plugin-ansible_v1.1.1_x5.0_linux_amd64"
Failed getting the "github.com/ivoronin/sshkey" plugin:
2 errors occurred:
        * could not get sha256 checksum file for github.com/ivoronin/sshkey version 1.2.0. Is the file present on the release and correctly named ? GET https://github.com/ivoronin/packer-plugin-sshkey/releases/download/v1.2.0/packer-plugin-sshkey_v1.2.0_SHA256SUMS: 404  []
        * could not install any compatible version of plugin "github.com/ivoronin/sshkey"
baizon commented 3 months ago

Indeed, the reason is, that the goreleaser action is failing (https://github.com/ivoronin/packer-plugin-sshkey/actions/runs/9406982593). I also noticed it and fixed all the issues I found in the next pull request: https://github.com/ivoronin/packer-plugin-sshkey/pull/67 After that merge the makefile should be fixed and the missing sha256 should be also released.

bigpick commented 3 months ago

awesome, did happen to notice that - had already subbed to that PR:); thx!

baizon commented 3 months ago

New version (https://github.com/ivoronin/packer-plugin-sshkey/releases/tag/v1.2.1) is out. Working for me now 🥇