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

Templates in new-app allow not "closed" parameters #13994

Closed
soltysh opened this issue May 2, 2017 · 8 comments
Closed

Templates in new-app allow not "closed" parameters #13994

soltysh opened this issue May 2, 2017 · 8 comments
Assignees
Labels
component/build kind/bug Categorizes issue or PR as related to a bug. priority/P2

Comments

@soltysh
Copy link
Contributor

soltysh commented May 2, 2017

Currently our templates allow both types of parameters ${foo and ${foo}. As long as the latter is perfectly fine, the former is wrong and should error out

@soltysh soltysh changed the title Templates allow not closed" parameters Templates allow not "closed" parameters May 2, 2017
@soltysh soltysh added kind/bug Categorizes issue or PR as related to a bug. priority/P2 labels May 2, 2017
@bparees bparees assigned oatmealraisin and unassigned bparees May 2, 2017
@bparees
Copy link
Contributor

bparees commented May 2, 2017

Is this different from the new-app issue you found?

@soltysh
Copy link
Contributor Author

soltysh commented May 2, 2017

That's the one, I moved it here so it doesn't get forgotten.

@bparees
Copy link
Contributor

bparees commented May 3, 2017

ok so it's not a template issue. it's a new-app issue.

specifically IsParameterizableValue() in app.go isn't being as strict in its checking for "things that look like parameters" as it should be because it doesn't require a closing "}" in the value.

@smarterclayton never weighed back in as to whether that was intentional but i assume it was just a lazy check as originally written and we should be fine to add the stricter checking.

@smarterclayton
Copy link
Contributor

smarterclayton commented May 3, 2017 via email

@soltysh soltysh changed the title Templates allow not "closed" parameters Templates in new-app allow not "closed" parameters May 3, 2017
@soltysh
Copy link
Contributor Author

soltysh commented May 3, 2017

Hmmm... can't we do strict checking on the master as well?

@bparees
Copy link
Contributor

bparees commented May 3, 2017 via email

@bparees
Copy link
Contributor

bparees commented May 3, 2017

It was intended to be lazy since a precise check would potentially be out of sync with parameter parsing on the master.

i don't see us ever not requiring a closing } when parsing parameters. What has to go in between the {}s might be more questionable, but at a minimum ${.*} seems like an acceptable regex to validate against. For bonus points, perhaps ${[^\s].*} (any non-whitespace character) would be ok.

@smarterclayton
Copy link
Contributor

smarterclayton commented May 4, 2017 via email

@bparees bparees closed this as completed May 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/build kind/bug Categorizes issue or PR as related to a bug. priority/P2
Projects
None yet
Development

No branches or pull requests

5 participants