names mixed up change

dev/vinu
Vinu.Kaveesha 2 months ago
parent b3ca1d5a8a
commit f68677c87a

@ -2,7 +2,7 @@ import os
import yaml
# Directory containing the YAML files
SECRET_DIR = "configmaps"
CONFIG_DIR = "configmaps"
MAPPING_YML = "config_mappings.yml"
# Load the placeholder mappings
@ -25,9 +25,9 @@ def replace_placeholders(obj):
replace_placeholders(item)
# Process all YAML files and replace placeholders
for filename in os.listdir(SECRET_DIR):
for filename in os.listdir(CONFIG_DIR):
if filename.endswith(".yml") or filename.endswith(".yaml"):
file_path = os.path.join(SECRET_DIR, filename)
file_path = os.path.join(CONFIG_DIR, filename)
with open(file_path, "r") as file:
data = yaml.safe_load(file)

@ -2,7 +2,7 @@ import os
import yaml
from collections import defaultdict
SECRET_DIR = "configmaps"
CONFIG_DIR = "configmaps"
OUTPUT_YML = "config_mappings.yml"
PLACEHOLDER_PREFIX = "PH_"
@ -68,17 +68,17 @@ def replace_common_values(obj):
replace_common_values(item)
# First pass: Identify common values
for filename in os.listdir(SECRET_DIR):
for filename in os.listdir(CONFIG_DIR):
if filename.endswith(".yml") or filename.endswith(".yaml"):
file_path = os.path.join(SECRET_DIR, filename)
file_path = os.path.join(CONFIG_DIR, filename)
with open(file_path, "r") as file:
data = yaml.safe_load(file)
find_common_values(data, filename=filename)
# Second pass: Replace common values
for filename in os.listdir(SECRET_DIR):
for filename in os.listdir(CONFIG_DIR):
if filename.endswith(".yml") or filename.endswith(".yaml"):
file_path = os.path.join(SECRET_DIR, filename)
file_path = os.path.join(CONFIG_DIR, filename)
with open(file_path, "r") as file:
data = yaml.safe_load(file)
modified = False

@ -2,8 +2,8 @@ import os
import yaml
from collections import defaultdict
SECRET_DIR = "configmaps"
OUTPUT_YML = "config_mappings.yml"
SECRET_DIR = "secrets"
OUTPUT_YML = "secret_mappings.yml"
PLACEHOLDER_PREFIX = "PH_"
secret_mappings = {}

Loading…
Cancel
Save