hashicorp / hashicorp/packer-plugin-scaffolding

How to get packer to use "dev" version of plugin

Open
#92 4 comments 1 reaction 0 assignees View on GitHub
documentation
Dominant language
Go
Stars
48
Forks
29
PR merge metrics
No merged PRs in 30d

Description

The GNUmakefile supplied with this project helpfully provides a dev target that builds the plugin and copies it to ~/.packer.d/plugins. However I am currently unable to get packer to use that generated version.

Here is what "packer-plugin-lxdapi describe" returns for me
{"version":"0.0.4-dev","sdk_version":"0.3.1","api_version":"x5.0","builders":["builder"],"post_processors":[],"provisioners":[],"datasources":[]}

Here is the output from packer when I try to use my plugin. You can see that it finds the plugin under "/home/dman/.packer.d/plugins/packer-plugin-lxdapi". However I cant seem to find a packer invocation / version specification where I could coax packer into using this locally built packer plugin over the ones that are uploaded from github.

Could you please clarify what the local development workflow for plugins should look like?

`2023/02/20 04:05:38 [INFO] Packer version: 1.8.5 [go1.18.9 linux amd64]
2023/02/20 04:05:38 Old default config directory found: /home/dman/.packer.d
2023/02/20 04:05:38 [TRACE] discovering plugins in /usr/bin
2023/02/20 04:05:38 Old default config directory found: /home/dman/.packer.d
2023/02/20 04:05:38 [TRACE] discovering plugins in /home/dman/.packer.d/plugins
2023/02/20 04:05:38 [DEBUG] Discovered plugin: lxdapi = /home/dman/.packer.d/plugins/github.com/deepankarsharma/lxdapi/packer-plugin-lxdapi_v0.0.2_x5.0_linux_amd64
2023/02/20 04:05:38 [DEBUG] Discovered plugin: lxdapi = /home/dman/.packer.d/plugins/github.com/deepankarsharma/lxdapi/packer-plugin-lxdapi_v0.0.4_x5.0_linux_amd64
2023/02/20 04:05:38 [INFO] found external [builder] builders from lxdapi plugin
2023/02/20 04:05:38 [DEBUG] Discovered plugin: lxdapi = /home/dman/.packer.d/plugins/packer-plugin-lxdapi
2023/02/20 04:05:38 [INFO] found external [builder] builders from lxdapi plugin
2023/02/20 04:05:38 [TRACE] discovering plugins in .
2023/02/20 04:05:38 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/02/20 04:05:38 [INFO] PACKER_CONFIG env var set; attempting to open config file: /home/dman/.packerconfig
2023/02/20 04:05:38 [WARN] Config file doesn't exist: /home/dman/.packerconfig
2023/02/20 04:05:38 Old default config directory found: /home/dman/.packer.d
2023/02/20 04:05:38 [INFO] Setting cache directory: /home/dman/.cache/packer
2023/02/20 04:05:38 Old default config directory found: /home/dman/.packer.d
2023/02/20 04:05:38 [TRACE] listing potential installations for "github.com/deepankarsharma/lxdapi" that match "0.0.4-dev". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/usr/bin/packer", ".", "/home/dman/.packer.d/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc0001fab80)}}}}
2023/02/20 04:05:38 [TRACE] version "v0.0.2" of file "/home/dman/.packer.d/plugins/github.com/deepankarsharma/lxdapi/packer-plugin-lxdapi_v0.0.2_x5.0_linux_amd64" does not match constraint "0.0.4-dev"
2023/02/20 04:05:38 [TRACE] version "v0.0.4" of file "/home/dman/.packer.d/plugins/github.com/deepankarsharma/lxdapi/packer-plugin-lxdapi_v0.0.4_x5.0_linux_amd64" does not match constraint "0.0.4-dev"`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the GNUmakefile's dev target and the reported Packer plugin discovery output, including the version constraint for 0.0.4-dev. Clarify the local development workflow for using the generated plugin, and consider the work complete when the documented invocation or version specification explains how to select it over uploaded versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.