3 Commits
1.0.1 ... 1.0.5

Author SHA1 Message Date
827ebdadad fix 2023-11-08 14:55:05 +01:00
3d28188833 fix 2023-11-08 14:49:48 +01:00
52d690c382 fix 2023-11-08 14:48:19 +01:00
2 changed files with 5 additions and 3 deletions

View File

@ -35,7 +35,7 @@ spec:
spec:
containers:
- name: pv-controller
image: wollud1969/pv-controller:1.0.0
image: wollud1969/pv-controller:1.0.4
envFrom:
- configMapRef:
name: pv-controller

View File

@ -1,4 +1,5 @@
import os
from loguru import logger
class Config:
OPTIONS = {
@ -17,15 +18,16 @@ class Config:
def __init__(self):
self.values = {}
for section, keys in Config.OPTIONS:
for section, keys in Config.OPTIONS.items():
self.values[section] = {}
for key in keys:
varname = f"{section}__{key}".upper()
try:
self.values[section][key] = os.environ[varname]
logger.info(f"Config: {section} {key} -> {self.values[section][key]}")
except KeyError:
pass
def __getitem__(self, section):
return self.values[index]
return self.values[section]