<#91 Fix secret> Pull request opened by <pingsutw>...
# flyte-github
c
#91 Fix secret Pull request opened by pingsutw This pull request introduces improvements to secret handling and environment variable naming conventions, updates documentation and examples for clarity, and refines related tests to match the new behavior. The main focus is on standardizing how secrets are exposed as environment variables and improving usability for developers. ### Secret handling and environment variable naming • Updated the logic in the
Secret
class so that if neither
mount
nor
as_env_var
is specified, the environment variable name is automatically generated by combining the group and key, replacing hyphens with underscores, and converting to uppercase (e.g.,
"my-secret"
becomes
"MY_SECRET"
). This ensures consistency and reduces manual configuration. • Changed the default mounting behavior for secrets to use environment variables (
ENV_VAR
) instead of files, and updated the corresponding test assertions to expect the new environment variable names. [1] [2] ### Documentation and examples • Updated the documentation and example code in
src/flyte/_secret.py
to clarify the new environment variable naming convention and usage, including how to specify custom environment variable names with
as_env_var
. Also added notes about current limitations and future TODOs. ### Minor code and formatting improvements • Reformatted the
image_from_env.py
example for improved readability and added a blank line for consistency. [1] [2] flyteorg/flyte-sdk