ddelnano / packer-plugin-xenserver

A builder plugin for Packer.IO to support building XenServer images.
Mozilla Public License 2.0
74 stars 37 forks source link

Change version in main.go #136

Closed AtaxyaNetwork closed 4 months ago

AtaxyaNetwork commented 4 months ago

Since the last packer update (1.11.0, release on the 2024-05-31), Hashicorp introduce a breaking change.

A colleague installed today the last packer version and had this message:

packer init build-the-VM.pkr.hcl 
Failed getting the "github.com/ddelnano/xenserver" plugin:
2 errors occurred:
    * Continuing to next available version: binary reported version ("v0.6.0") is different from the expected "0.7.0", skipping
    * could not install any compatible version of plugin "github.com/ddelnano/xenserver"

He had to downgrade his packer to stay on version 1.10.3.

I checked in the plugin code by curiosity, and saw it was simply a line in the main.go that needed a change :D

So, this is my PR :)

I suppose I can be automated, but I have no idea how to do that.

Thank you for your time and your work @ddelnano

ddelnano commented 4 months ago

@AtaxyaNetwork thanks for calling out this breaking change and identifying a fix!

137 should have fixed this and has the benefit of working without code changes to support later release versions. Please give the latest release a try when you have the chance. I did some slight verification, but wasn't able to try the new packer version.

# Verify new string is present -- hard to tell exactly what this string refers to since verison.Version is stripped from the binary
$ strings ~/Downloads/packer-plugin-xenserver_v0.7.1_x5.0_linux_amd64 | grep '0\.7\.1'
0.7.1
$

# Verify old string is gone 
$ strings ~/Downloads/packer-plugin-xenserver_v0.7.1_x5.0_linux_amd64 | grep 'v0\.6\.1'
$
AtaxyaNetwork commented 4 months ago

Hi @ddelnano, Thank you for the fix !

With

root@Grille-Pain:~# packer -v
Packer v1.11.0

and

   xenserver = {
      version = "= v0.7.1"
      source = "github.com/ddelnano/xenserver"
   }

It's working !

I'll close this PR, thank you again for your time !