Export more variable for secret template

main
Lauri Võsandi 2 months ago
parent 0cf55d70af
commit c6a8c6899c
  1. 6
      generated-secret-operator.py

@ -24,7 +24,11 @@ async def apply_changes(item, v1, apps_api, api_instance):
password = "".join([random.choice(string.ascii_letters + string.digits) for j in range(item["spec"]["size"])])
data = {}
for o in item["spec"]["mapping"]:
data[o["key"]] = o["value"] % {"password": password}
data[o["key"]] = o["value"] % {
"name": name,
"namespace": namespace,
"password": password,
}
try:
await v1.create_namespaced_secret(namespace, body={
"metadata": {

Loading…
Cancel
Save