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

rules-check doesn't accept globs as described in the documentation #4082

Closed
gregoryfranklin opened this issue Apr 20, 2021 · 2 comments · Fixed by #4105
Closed

rules-check doesn't accept globs as described in the documentation #4082

gregoryfranklin opened this issue Apr 20, 2021 · 2 comments · Fixed by #4105

Comments

@gregoryfranklin
Copy link

The example rules-check command states that rules-check takes a glob of rules files

./thanos tools rules-check --rules cmd/thanos/testdata/rules-files/*.yaml

https://thanos.io/v0.19/components/tools.md/#rules-check
But this does not work for me.

You either get shell expansion of the glob, resulting in:

./thanos tools rules-check --rules config/rules/*.yaml
error parsing commandline arguments: [/bin/thanos tools rules-check --rules config/rules/file1.yaml config/rules/file2.yaml]: unexpected config/rules/file2.yaml
thanos: error: unexpected config/rules/file2.yaml

Or without shell expansion:

./thanos tools rules-check --rules=config/rules/*.yaml
error parsing commandline arguments: [/bin/thanos tools rules-check --rules=config/rules/*.yaml]: path 'config/rules/*.yaml' does not exist
usage: thanos tools rules-check --rules=RULES

The only form that does work is

./thanos tools rules-check --rules config/rules/file1.yaml --rules config/rules/file2.yaml

This is either a documentation error or the glob handling is not working.

@GiedriusS
Copy link
Member

It seems like we use ExistingFiles() which allows you to specify multiple files that exist but it doesn't support regular expressions. IMHO we should add support for that. Help wanted!

@rhassanein
Copy link
Contributor

Which version is this fixed in? I just ran into it in both v0.20.1 and v0.20.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants