YaleUniversity / packer-plugin-goss

Goss Provisioner for Packer
MIT License
136 stars 45 forks source link

Cannot initialize plugin with Packer 1.11.z due to plugin version mismatch error #90

Closed F21 closed 1 month ago

F21 commented 1 month ago

When trying to initialize the plugin with Packer 1.11.z, I get the following error:

Failed getting the "github.com/YaleUniversity/goss" plugin:
11 errors occurred:
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.10", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.8", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.7", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.6", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.5", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.4", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.3", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.2", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.1", skipping
        * could not get sha256 checksum file for github.com/YaleUniversity/goss version 3.2.0. Is the file present on the release and correctly named ? GET https://github.com/YaleUniversity/packer-plugin-goss/releases/download/v3.2.0/packer-plugin-goss_v3.2.0_SHA256SUMS: 404  []
        * could not install any compatible version of plugin "github.com/YaleUniversity/goss"

It seems there's an issue with setting the version number using ldflags in Goreleaser: https://github.com/YaleUniversity/packer-plugin-goss/blob/master/main.go#L14

FalcoSuessgott commented 1 month ago

You have to use the latest plugin version (3.2.10) in your packer plugin configuration

F21 commented 1 month ago

I am using:

 goss = {
      version = "~> 3.2"
      source  = "github.com/YaleUniversity/goss"
    }

From testing locally, I don't think main.Version is being set correctly in goreleaser's ldflags config.

FalcoSuessgott commented 1 month ago

Will check asap, something is going on I tested the release CI assets a few times but I guess one PR messed with the goreleaser config ..

F21 commented 1 month ago

I don't think it was ever working properly before. Looking at the history of .goreleaser.yml, these 2 lines have never changed:

I think the version has always been set to 0.0.1 and packer has only started enforcing the version check in the 1.11.z release.

FalcoSuessgott commented 1 month ago

Yeah seems likes it but a local packer init has always worked for me. But will investigate later and hopefully fix it for good

F21 commented 1 month ago

The plugin version check was only released in Packer 1.11.0, which was released a few days ago. See:

FalcoSuessgott commented 1 month ago

Oh that makes sense! Thanks for investigating