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 58e0d17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fireconfig"
version = "0.5.0"
version = "0.5.1"
description = "Configuration language for Kubernetes manifests"
authors = ["David Morrison <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 58e0d17

Please sign in to comment.