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 vault_regexp #78

Closed
pezhovski opened this issue Feb 18, 2021 · 5 comments · Fixed by #79
Closed

Incorrect vault_regexp #78

pezhovski opened this issue Feb 18, 2021 · 5 comments · Fixed by #79

Comments

@pezhovski
Copy link

Hi, trying to use vault driver and getting grep error.
I'm not sure why, but [A-z]* leads to grep: Invalid range end error.
Replacing it with [a-zA-Z] seems to resolve this.

@zied-jt
Copy link

zied-jt commented Feb 18, 2021

Hi, I'm also affected by the grep: Invalid range end with the vault driver. I think it's related to how locale are set in the user env for Linux users.

From grep manual:

LC_ALL, LC_COLLATE, LANG
These variables specify the locale for the LC_COLLATE category, which determines the collating sequence used to interpret range expressions like [a-z].

So, It should be fixed just with setting LC_COLLATE=C (or LC_COLLATE=POSIX) by exporting the var to the current shell (it could change other tools behaviors like sort, so careful if it will be set as default value: https://unix.stackexchange.com/questions/75341/specify-the-sort-order-with-lc-collate-so-lowercase-is-before-uppercase)

@jkroepke what about either having a hint about this in the README or forcing LC_COLLATE in the helm-secret grep at line https://github.com/jkroepke/helm-secrets/blob/main/scripts/drivers/_custom.sh#L18

@jkroepke
Copy link
Owner

Crazy errors.

@zied-jt Thanks for figure it out.

What about just put the env in front of the regex command, like:

LC_ALL=C.UTF-8 grep -q -e "${_DRIVER_REGEX}" "${input}"

That should be resolve the error in general without leaving a hint.

@zied-jt
Copy link

zied-jt commented Feb 18, 2021

@jkroepke Thanks for the quick replay. I'm ok with your fix.

I want also to thank @rasta-rocket for helping me figure out this weird error.

@jkroepke
Copy link
Owner

Could someone verifies that this is working?

#79

@pezhovski
Copy link
Author

@jkroepke It certainly fixes my case, thanks!)

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

Successfully merging a pull request may close this issue.

3 participants