quick question, is there any way to request for specific secrets based on the parameter of the task? For example, if I wanted to print the secret for a specific group, I would have to request secrets for all possible groups
Hi Eric, at the moment parameterized secrets isn’t supported… I do have a few questions:
1. how many groups do you have?
2. does it make sense for you to expose the task to all group secrets?
If you know the groups ahead of time, you could do something like:
Copy code
@task(secret_requests=[
Secret(group=g, key='my_key') for g in groups
]):
def print_secret(group: str):
sm = current_context().secrets
secret = sm.get(group, 'my_key')
print(secret)
b
boundless-sunset-37446
08/19/2022, 2:41 PM
We have a couple groups (10-20) with a standard set of keys that we know ahead of time. Currently I'm exposing them all with something like that but was curious if there was a more elegant solution.
boundless-sunset-37446
08/19/2022, 2:50 PM
thanks for the help! 🙂
f
freezing-airport-6809
08/19/2022, 2:51 PM
Secrets dynamically is not possible as we have to mount things in, this is part of declarative infrastructure
b
boundless-sunset-37446
08/19/2022, 3:08 PM
That's good to know. I will rethink some of our organization then