diff --git a/pkg/porter/parameters.go b/pkg/porter/parameters.go index 476025d96..897db5c02 100644 --- a/pkg/porter/parameters.go +++ b/pkg/porter/parameters.go @@ -891,6 +891,12 @@ func (p *Porter) applyActionOptionsToInstallation(ctx context.Context, ba Bundle resolvedParams[k] = v } + for name, value := range parsedOverrides { + if strings.Contains(name, "#") { + resolvedParams[name] = value + } + } + // // 6. Separate out params for the root bundle from the ones intended for dependencies // This only applies to the dep v1 implementation, in dep v2 you can't specify rando params for deps diff --git a/pkg/porter/parameters_test.go b/pkg/porter/parameters_test.go index 314f68a8b..89e010a0c 100644 --- a/pkg/porter/parameters_test.go +++ b/pkg/porter/parameters_test.go @@ -917,3 +917,30 @@ func TestParameterRemovedFromBundle(t *testing.T) { err := p.applyActionOptionsToInstallation(ctx, opts, &installation) require.NoError(t, err) } + +func Test_DependencyParameterOverride(t *testing.T) { + ctx := context.Background() + p := NewTestPorter(t) + p.TestConfig.TestContext.AddTestFile("testdata/porter.yaml", "porter.yaml") + opts := InstallOptions{ + BundleExecutionOptions: &BundleExecutionOptions{ + Params: []string{ + "dep#first-param=1", + }, + Driver: "docker", + BundleReferenceOptions: &BundleReferenceOptions{ + installationOptions: installationOptions{ + BundleDefinitionOptions: BundleDefinitionOptions{ + File: config.Name, + }, + Name: "MyInstallation", + }, + }, + }, + } + + installation := storage.NewInstallation(opts.Namespace, opts.Name) + err := p.applyActionOptionsToInstallation(ctx, opts, &installation) + require.NoError(t, err) + assert.Equal(t, opts.depParams["dep#first-param"], "1") +}