hera
hera copied to clipboard
SecretEnv not working in Template
Pre-bug-report checklist
1. This bug can be reproduced using pure Argo YAML
- [ ] Yes 👉 Please report a bug to the Argo Workflows GitHub 👈
- [X] No
If yes, it is more likely to be an Argo bug unrelated to Hera. Please double check before submitting an issue to Hera.
2. This bug occurs in Hera when...
- [X] exporting to YAML
- [ ] submitting to Argo
- [ ] running on Argo with the Hera runner
- [ ] other:
Bug report
Describe the bug
When using SecretEnv
in a Template
, it is not expanded and the resulting entry in env
only contains the name
.
To Reproduce Full Hera code to reproduce the bug:
from hera.workflows import (
Container,
Env,
SecretEnv,
WorkflowTemplate,
)
from hera.workflows.models import Template
whalesay = Container(
image="docker/whalesay:latest",
command=["cowsay"],
env=[
Env(name="test", value="1"),
SecretEnv(name="s1", secret_key="s1", secret_name="abc"),
],
)
templates = [Template(name="test", container=whalesay)]
wt = WorkflowTemplate(name="test", templates=templates)
print(wt.templates[0].container.env)
Results:
[EnvVar(name='test', value='1', value_from=None), EnvVar(name='s1', value=None, value_from=None)]
Expected behavior
SecretEnv
should be expanded into EnvVar
that it's value_from
property is populated.
Environment
- Hera Version: 5.15.1
- Python Version: 3.10.13
- Argo Version: 3.5.6