Skip to content

Removing common path with regexp rewrite is not working as documented #1447

@shiehand

Description

@shiehand

Describe the solution you'd like
I am trying to use dataFrom.find to get multiple secrets from AWS Parameter Store, trying to remove the common path by following the documentation https://external-secrets.io/v0.5.9/guides-datafrom-rewrite/

    - regexp:
        source: "path/to/my/secrets/(.*)"
        target: "$1"

Using this regexp didn't do anything to the generated secret keys:
For secrets:

path/to/my/secrets/username
path/to/my/secrets/password

Generated keys:

apiVersion: v1
kind: Secret
type: Opaque
data:
   _path_to_my_secrets_username: ...
   _path_to_my_secrets_password: ...

However, using this regexp:

    - regexp:
        source: "_path_to_my_secrets_(.*)"
        target: "$1"

Does output only the last path as expected:

apiVersion: v1
kind: Secret
type: Opaque
data:
   username: ...
   password: ...

What is the added value?
The feature works with the regexp with underscores (instead of slashes), but I would like a confirmation on whether this is a documentation mistake or an actual bug. Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/awsIndicates an issue or PR related to AWS.good first issueGood for newcomerskind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions