hashicorp / packer-plugin-vsphere

Packer plugin for VMware vSphere Builder
https://www.packer.io/docs/builders/vsphere
Mozilla Public License 2.0
95 stars 90 forks source link

Out-of-date source repo in documenation? #288

Closed lindhe closed 1 year ago

lindhe commented 1 year ago

Is this link out of date? AFAICT, the repo exists here on https://github.com/hashicorp/packer-plugin-vsphere not https://github.com/hashicorp/vsphere.

https://github.com/hashicorp/packer-plugin-vsphere/blob/5dfa6e5da2bdf1f7427878df0efa49f3cf115fea/docs/builders/index.mdx#L41

tenthirtyam commented 1 year ago

Each of the HashiCorp Packer plugins follow this source format.

cc @nywilken

lindhe commented 1 year ago

I'm completely at loss as to how the plugin can resolve at all! I get a 404 when I visit github.com/hashicorp/vsphere, yet it is successfully fetched by packer plugins install:

image

$ packer plugins install github.com/hashicorp/vsphere
Installed plugin github.com/hashicorp/vsphere v1.2.0 in "/home/andreas/.config/packer/plugins/github.com/hashicorp/vsphere/packer-plugin-vsphere_v1.2.0_x5.0_linux_amd64"

$ tree
.
└── vsphere
    ├── packer-plugin-vsphere_v1.2.0_x5.0_linux_amd64
    └── packer-plugin-vsphere_v1.2.0_x5.0_linux_amd64_SHA256SUM

After some fiddling around, I find that it seems to expect the URI to be in a certain format and then makes some sort of rewrite of it:

$ packer plugins install github.com/hashicorp/packer-plugin-vsphere
<nil>: Invalid plugin type; Plugin source "github.com/hashicorp/vsphere" has a type with the prefix "packer-plugin-", which isn't valid. Although that prefix is often used in the names of version control repositories for Packer plugins, plugin source strings should not include it.

Did you mean "github.com/hashicorp/vsphere"?

I concede that my original issue is void. But... Is this not insanity? Arbitrarily rewriting what would have otherwise been a perfectly fine repo URI seems like such an odd design choice... 😕

lindhe commented 1 year ago

Curiously, I found this comment in the code:

// Due to how plugin executables are named and plugin git repositories // are conventionally named, it's a reasonable and // apparently-somewhat-common user error to incorrectly use the // "packer-plugin-" prefix in a plugin source address. There is // no good reason for a plugin to have the prefix "packer-" anyway, // so we've made that invalid from the start both so we can give feedback // to plugin developers about the packer- prefix being redundant // and give specialized feedback to folks who incorrectly use the full // packer-plugin- prefix to help them self-correct.

Does this mean that this repo is technically incorrectly named according to your own best practices?

tenthirtyam commented 1 year ago

This concern would best be addressed in hashicorp/packer as this is the naming convention for most all registered plugin projects, not just this plugin.

Ref: https://github.com/hashicorp/packer/blob/main/website/data/plugins-manifest.json