<#6304 [BUG] putting secrets into env vars doesn't...
# flyte-github
c
#6304 [BUG] putting secrets into env vars doesn't work with AWS Secrets Manager Issue created by bra-fsn ### Describe the bug I'm trying to use the new
env_var
argument for
Secret
, but the secret is not placed into any of the environment variables, no matter if I specify this argument or not. Python pkg versions:
Copy code
flyteidl==1.15.1
flytekit==1.15.0
Flyte version: 1.15.0 ### Expected behavior I would expect that if I get a secret from AWS Secrets Manager, it is placed into an env var if
mount_requirement=Secret.MountType.ENV_VAR
is given and into the specific env var if
env_var="TEST_ENV"
or similar is given. ### Additional context to reproduce This doesn't work: @task( secret_requests=[ Secret(env_var="TEST_ENV", group=SECRET_GROUP, key=SECRET_KEY, mount_requirement=Secret.MountType.ENV_VAR) ] ) def get_secret_env() -> str: import os return f"env {os.getenv('TEST_ENV')}"
TEST_ENV
is missing. If I remove
env_var="TEST_ENV"
, the secret is not placed into any of the env vars of that task either. This in contrast works: @task( secret_requests=[ Secret(group=SECRET_GROUP, key=SECRET_KEY, mount_requirement=Secret.MountType.FILE) ] ) def get_secret_file() -> str: ctx = current_context() token = ctx.secrets.get(SECRET_GROUP, SECRET_KEY) return f"file {token}" I'm using core: webhook: secretManagerType: "AWS" in the helm values.yaml. ### Screenshots No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte