Skip to content

fix: make file marks behave properly (doublestar glob or regex , no weird glob-to-regex behavior) #966

@gabyx

Description

@gabyx

Describe the problem/challenge you have

Filemarks paths like **/*/output:type=data get internally replaced to a regex .+/output which lead to bogus unintuitive bugs.
Also **/*/output/**/*/a does not work as the replacement is single only (why is questionable)?

https://github.com/carvel-dev/ytt/blob/develop/pkg/cmd/template/file_marks.go#L131

Describe the solution you'd like

  • Use the library https://github.com/bmatcuk/doublestar#match
    where one has sane glob behavior with **/output/a/**/a etc..

  • Or do only support regexes and do not mix them. I would say it confuses usage and is not a nice behavior.

  • Or less recommended: support using **/* multiple times (strings.ReplaceAll). But going the road of doing some weird globbing (**/* cannot represent ** glob which can match nothing) is not gonna help the long term.

Anything else you would like to add:

Going the doublestar way, I can implement this in a PR.


Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    carvel triageThis issue has not yet been triaged for relevanceenhancementThis issue is a feature requeststaleThis issue has had no activity for a while and will be closed soon

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions