cuddly-jelly-27016
06/29/2025, 12:11 AMenv_var doesn't seem to be used.
Issue created by cjidboon94
### Describe the bug
I am running flytekit 1.15.0
I have a task that uses secrets. An example would be:
SECRET_GROUP = "secretgroup"
SECRET_KEY = "thesecret"
@task(secret_requests=[
Secret(group=SECRET_GROUP, env_var="MY_SECRET", key=SECRET_KEY)
])
def my_task
context = flytekit.current_context()
secret_val = context.secrets.get(SECRET_GROUP, SECRET_KEY)
do_something_with_secret_val(secret_val)
When I run this remotely, this is fine. But when I run this locally (having set the correct environment variables), I get the following error:
Error encountered while executing 'my_task':
Please make sure to add secret_requests=[Secret(group=secretgroup, key=thesecret)] in @task. Unable to find secret for key endpoint in group secretgroup in Env Var:SECRETGROUP_THESECRET and FilePath: /etc/secrets/secretgroup/thesecret
### Expected behavior
I would expect that flyte would look if the env var MY_SECRET would exist instead of SECRETGROUP_THESECRET.
### Additional context to reproduce
No response
### Screenshots
No response
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flytecuddly-jelly-27016
06/29/2025, 12:11 AMenv_var doesn't seem to be used.
Issue closed as not planned by github-actions[bot]
flyteorg/flyte