Skip to content

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

Closed

Description

@soltysh

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

Activity

  1. changed the title [-]Templates allow not closed" parameters[/-] [+]Templates allow not "closed" parameters[/+] on May 2, 2017
  2. added
    kind/bug
    on May 2, 2017
  3. bparees commented on May 2, 2017

    @bparees
    Contributor

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

  4. soltysh commented on May 2, 2017

    @soltysh
    ContributorAuthor

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

  5. bparees commented on May 3, 2017

    @bparees
    Contributor

    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.

  6. smarterclayton commented on May 3, 2017

    @smarterclayton
    Contributor
  7. changed the title [-]Templates allow not "closed" parameters[/-] [+]Templates in new-app allow not "closed" parameters[/+] on May 3, 2017
  8. soltysh commented on May 3, 2017

    @soltysh
    ContributorAuthor

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

  9. bparees commented on May 3, 2017

    @bparees
    Contributor
  10. bparees commented on May 3, 2017

    @bparees
    Contributor

    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.

  11. smarterclayton commented on May 4, 2017

    @smarterclayton
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

component/buildkind/bugpriority/P2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions