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

sops fails to match path_regex on Windows because it encounters '\', not '/' #892

Open
cameronkerrnz opened this issue Jun 29, 2021 · 2 comments

Comments

@cameronkerrnz
Copy link

Given a directory called my-local on Windows, the following will FAIL to match

creation_rules:
  - path_regex: .*/my-local/.*
    ...

But the following will:

creation_rules:
  # Sigh; must match the native idea of what filepath separator is used...
  - path_regex: .*[/\\]my-local[/\\].*
    ...

Windows 10 20H2
sops 3.7.1 (latest)

WSL-2 is not being used; sops is being run from a PowerShell session

Sops should ideally canonicalise the path separator, perhaps following established behaviour in the likes of .gitignore and .dockerignore files.

Documenting what the regex would begin to match on would be good too and any implicit anchoring that may be in effect.

@Moskovych
Copy link

@autrilla @ajvb
Is there any chance to clarify the behavior of sops regex match?
Should we duplicate the records for Linux/MacOS and Windows separately?
Or write complex universal matches?

@felixfontein
Copy link
Contributor

See also #1036 and #1523.

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

No branches or pull requests

3 participants