-
Notifications
You must be signed in to change notification settings - Fork 404
feat: allow permitted-key-name to be provided as list #409
Conversation
This PR needs #411 for tests to pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small refactor request
lib/poller.js
Outdated
let reNaming = new RegExp() | ||
if (Array.isArray(namingConvention)) { | ||
reNaming = new RegExp(namingConvention.join('|')) | ||
} else { | ||
reNaming = new RegExp(namingConvention) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can move this out of the loop so its only done once eg moving it after const namingConvention = namespace.metadata.annotations[this._namingPermittedAnnotation]
, should be fine even if we there's no namingConvention
set. Keeping the if
checks the same
Then we also shouldn't need to repeat the logic for dataFrom
below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, totally. I was mislead by the const reNaming = new RegExp(namingConvention)
in the forEach
loop.
@nbendafi-yseop Is it possible (k8s perspective) to have a list value for an annotation? |
@ronlut From my understanding of those statements
and
yes they are strings but can represent anything that the application, that consumes them, can understand (ex. raw string, base64 encoded, csv,...). |
Thanks @nbendafi-yseop, the reason I am asking is I tried to create a namespace with your example, but it doesn't work:
|
@ronlut externalsecrets.kubernetes-client.io/permitted-key-name:
... by externalsecrets.kubernetes-client.io/permitted-key-name: |
... (ie. add a pipe). |
While documentation says that
permitted-key-name
can be provided as regular expressionit would be nice (clearer ?) if it can support list of regular expressions