zendesk / helm-secrets

DEPRECATED A helm plugin that help manage secrets with Git workflow and store them anywhere
Apache License 2.0
1.16k stars 155 forks source link

Support secrets[._-]*.yaml #128

Open schollii opened 5 years ago

schollii commented 5 years ago

There have been at least 2 other issues raised regarding the naming restrictions of helm secrets plugin on files it automatically identifies as containing secrets. Currently it is secrets.yaml and secrets.something.yaml (and something can contain dashes, underscores, letters, numbers). However I don't think it is very common for people to use dot as a separator to further qualify the purpose of a file. Most people would intuitively go for dash or underscore like secrets-myenv1.yaml or secrets_myenv1.yaml.

So I'd like to propose that the name search include not just dot, but also hyphen and underscore. I imagine there should only be a couple places in the code to fix, or are there a whole bunch? I don't mind doing it.

schollii commented 5 years ago

I think it would be sufficient to modify the pattern in secrets.sh, helm_wrapper command, ie https://github.com/futuresimple/helm-secrets/blob/5f91bdfc66bd901e3088aac2efa2d107a055ea39/secrets.sh#L441

to

if [[ $yml =~ ^(.*/)?secrets([_.-][^.]+)*\.yaml$ ]]

I'm going to try it out.

TravisWhitehead commented 4 years ago

This seems like something that should be configurable.