Skip to content

Commit

Permalink
inject secrets in env
Browse files Browse the repository at this point in the history
  • Loading branch information
drmorr0 committed Feb 17, 2024
1 parent 009ab7e commit 2f9fcbe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fireconfig/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ def with_field_ref(self, name: str, field: DownwardAPIField, key: T.Optional[str
self._env[name] = ("valueFrom", {"fieldRef": {"fieldPath": field_str}})
return self

def with_secret(self, name: str, secret_name: str, secret_key_name: str) -> T.Self:
self._env[name] = ("valueFrom", {"secretKeyRef": {"name": secret_name, "key": secret_key_name}})
return self

def build(self, names: T.Optional[T.Union[T.Sequence[str], T.KeysView[str]]] = None) -> T.Sequence[T.Mapping]:
if names is None:
names = self._env.keys()
Expand Down

0 comments on commit 2f9fcbe

Please sign in to comment.