fix: stop-only metadata no longer drops options for up/down

A previous change extended IsEmpty() to include `Stop == nil`. For a
provider that advertises only a `stop` block, this caused
commandMetadataIsEmpty to be false in setupPluginCommand, which made
the option-forwarding filter reject every key — silently dropping
all provider options on `up` and `down`.

The Stop-presence signal lives independently in stop.go and the
"stop" case of setupPluginCommand, so reverting the IsEmpty check
to its original semantics is sufficient.

Addresses PR #13779 review feedback.

Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
This commit is contained in:
Guillaume Lours 2026-05-07 22:27:42 +02:00
parent 38a12cfcbe
commit cb08950fda
No known key found for this signature in database
GPG key ID: 902F56FC16D4AA89
2 changed files with 3 additions and 8 deletions

View file

@ -265,7 +265,7 @@ type ProviderMetadata struct {
}
func (p ProviderMetadata) IsEmpty() bool {
return p.Description == "" && p.Up.Parameters == nil && p.Down.Parameters == nil && p.Stop == nil
return p.Description == "" && p.Up.Parameters == nil && p.Down.Parameters == nil
}
type CommandMetadata struct {

View file

@ -52,14 +52,9 @@ func TestProviderMetadata_IsEmpty(t *testing.T) {
want: false,
},
{
name: "only Stop set",
metadata: ProviderMetadata{Stop: &CommandMetadata{Parameters: param}},
want: false,
},
{
name: "Stop set with empty parameters",
name: "only Stop set is empty",
metadata: ProviderMetadata{Stop: &CommandMetadata{}},
want: false,
want: true,
},
{
name: "all fields set",