mirror of
https://github.com/docker/compose.git
synced 2026-05-13 13:58:02 +00:00
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:
parent
38a12cfcbe
commit
cb08950fda
2 changed files with 3 additions and 8 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue