From 58e0d1782d8dfdba16797a65b74dfd7eb74a502f Mon Sep 17 00:00:00 2001 From: David Morrison Date: Fri, 16 Feb 2024 21:58:37 -0800 Subject: [PATCH] inject secrets in env --- fireconfig/env.py | 4 ++++ pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fireconfig/env.py b/fireconfig/env.py index 9d20d80..16125ac 100644 --- a/fireconfig/env.py +++ b/fireconfig/env.py @@ -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() diff --git a/pyproject.toml b/pyproject.toml index 39bec30..f25b6a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] license = "MIT"