From f68677c87a36f8adca226afc4913a5efc4c40471 Mon Sep 17 00:00:00 2001 From: "Vinu.Kaveesha" Date: Thu, 27 Mar 2025 10:52:22 +0530 Subject: [PATCH] names mixed up change --- apply_config_mappings.py | 6 +++--- extract_common_config_mappings.py | 10 +++++----- extract_common_secret_mappings copy.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apply_config_mappings.py b/apply_config_mappings.py index 9748a7e..6f19562 100644 --- a/apply_config_mappings.py +++ b/apply_config_mappings.py @@ -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) diff --git a/extract_common_config_mappings.py b/extract_common_config_mappings.py index c2343c0..4f4b18c 100644 --- a/extract_common_config_mappings.py +++ b/extract_common_config_mappings.py @@ -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 diff --git a/extract_common_secret_mappings copy.py b/extract_common_secret_mappings copy.py index c2343c0..d720566 100644 --- a/extract_common_secret_mappings copy.py +++ b/extract_common_secret_mappings copy.py @@ -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 = {}