Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect number of parameters when generating parameter sets #1600

Closed
carolynvs opened this issue May 21, 2021 · 1 comment
Closed

Incorrect number of parameters when generating parameter sets #1600

carolynvs opened this issue May 21, 2021 · 1 comment
Labels
bug Oops, sorry! good first issue Good for new contributors

Comments

@carolynvs
Copy link
Member

carolynvs commented May 21, 2021

Describe the bug

Porter is showing the TOTAL number of parameters in the bundle, including porter specific parameters which are not included in the parameter set.

To Reproduce

Run porter parameters generate for any bundle. Note that it shows a number one higher than the number of parameters defined in porter.yaml because it is counting PORTER_DEBUG.

Expected behavior

It should show the number of parameters defined in porter.yaml.

Porter Command and Output

$ porter parameters generate hello-llama -r getporter/hello-llama:v0.1.0
Generating new parameter set hello-llama from bundle hello-llama
==> 2 parameters declared for bundle hello-llama

Version

porter v0.38.1-32-gb76f5c1c (b76f5c1c)

How to Fix

  • Create your fix based on the v1 branch. When you submit your PR, set the destination to the v1 branch.

  • This is the incorrect line of code. We should loop over the parameters in the bundle and count only parameters that are not internal. You can use this function IsInternal to know if it should be counted or not.

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

The output from this command is hard to unit test, since it is interactive, so testing manually is fine. You can run the command in the bug report to verify the fix is working.

@carolynvs carolynvs added bug Oops, sorry! Needs More Input 🦖🤖 Go back and fill in context and explain how to implement labels May 21, 2021
@carolynvs carolynvs added this to Inbox in Porter and Mixins via automation May 21, 2021
@carolynvs carolynvs added good first issue Good for new contributors and removed Needs More Input 🦖🤖 Go back and fill in context and explain how to implement labels May 24, 2021
@divbhasin divbhasin mentioned this issue Jun 6, 2021
3 tasks
@carolynvs
Copy link
Member Author

This is fixed in the v1 prerelease

Porter and Mixins automation moved this from Inbox to Done Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Oops, sorry! good first issue Good for new contributors
Projects
Development

No branches or pull requests

1 participant