Skip to content

Commit

Permalink
Count only the parameters in the parameter set (#1608)
Browse files Browse the repository at this point in the history
* fixed to count only internal params

Signed-off-by: div_bhasin <[email protected]>

* fix test

Signed-off-by: div_bhasin <[email protected]>

* fix mistake

Signed-off-by: div_bhasin <[email protected]>
  • Loading branch information
divbhasin authored Jun 2, 2021
1 parent a87b0f3 commit fea7bb9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/cnab/config-adapter/testdata/porter-with-maintainers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ credentials:
- uninstall

dependencies:
- name: mysql
reference: "getporter/azure-mysql:5.7"
requires:
- name: mysql
reference: "getporter/azure-mysql:5.7"

mixins:
- exec
Expand Down
10 changes: 9 additions & 1 deletion pkg/porter/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,15 @@ func (p *Porter) GenerateParameters(opts ParameterOptions) error {
Bundle: bundle,
}
fmt.Fprintf(p.Out, "Generating new parameter set %s from bundle %s\n", genOpts.Name, bundle.Name)
fmt.Fprintf(p.Out, "==> %d parameters declared for bundle %s\n", len(bundle.Parameters), bundle.Name)
numExternalParams := 0

for name := range bundle.Parameters {
if !parameters.IsInternal(name, bundle) {
numExternalParams += 1
}
}

fmt.Fprintf(p.Out, "==> %d parameters declared for bundle %s\n", numExternalParams, bundle.Name)

pset, err := genOpts.GenerateParameters()
if err != nil {
Expand Down

0 comments on commit fea7bb9

Please sign in to comment.