Set default namespace for KSU kustomizations to flux-system

Change-Id: I6643b9271f0e389ced44940eeabdf3d25acd3af0
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/osm_lcm/k8s.py b/osm_lcm/k8s.py
index 4440b5a..816eb28 100644
--- a/osm_lcm/k8s.py
+++ b/osm_lcm/k8s.py
@@ -2117,7 +2117,7 @@
         oka_list = op_params["oka"]
         oka_item = oka_list[0]
         oka_params = oka_item.get("transformation", {})
-        target_ns = oka_params.get("namespace", "default")
+        kustomization_ns = oka_params.get("kustomization_namespace", "flux-system")
         profile_id = op_params.get("profile", {}).get("_id")
         profile_type = op_params.get("profile", {}).get("profile_type")
         self.logger.info(
@@ -2136,7 +2136,7 @@
                     {
                         "item": "kustomization",
                         "name": kustomization_name,
-                        "namespace": target_ns,
+                        "namespace": kustomization_ns,
                         "condition": {
                             "jsonpath_filter": "status.conditions[?(@.type=='Ready')].status",
                             "value": "True",
@@ -2170,7 +2170,7 @@
         oka_list = db_ksu["oka"]
         oka_item = oka_list[0]
         oka_params = oka_item.get("transformation", {})
-        target_ns = oka_params.get("namespace", "default")
+        kustomization_ns = oka_params.get("kustomization_namespace", "flux-system")
         profile_id = op_params.get("profile", {}).get("_id")
         profile_type = op_params.get("profile", {}).get("profile_type")
         self.logger.info(
@@ -2189,7 +2189,7 @@
                     {
                         "item": "kustomization",
                         "name": kustomization_name,
-                        "namespace": target_ns,
+                        "namespace": kustomization_ns,
                         "deleted": True,
                         "timeout": self._checkloop_kustomization_timeout,
                         "enable": True,
diff --git a/osm_lcm/odu_libs/ksu.py b/osm_lcm/odu_libs/ksu.py
index 5937924..8bd6e25 100644
--- a/osm_lcm/odu_libs/ksu.py
+++ b/osm_lcm/odu_libs/ksu.py
@@ -63,6 +63,7 @@
     profile_type = MAP_PROFILE[profile_type]
     profile_name = ksu_params.get("profile", {}).get("name")
     age_public_key = ksu_params.get("profile", {}).get("age_pubkey")
+    kustomization_ns = oka_params.get("kustomization_namespace", "flux-system")
     target_ns = oka_params.get("namespace", "default")
     substitute_environment = oka_params.get("substitute_environment", "true").lower()
     custom_env_vars = oka_params.get("custom_env_vars", {})
@@ -70,6 +71,8 @@
         custom_env_vars["APPNAME"] = ksu_name
     if "TARGET_NS" not in custom_env_vars:
         custom_env_vars["TARGET_NS"] = target_ns
+    if "KUSTOMIZATION_NS" not in custom_env_vars:
+        custom_env_vars["KUSTOMIZATION_NS"] = kustomization_ns
     custom_env_vars_str = "|\n"
     substitution_filter_list = []
     for k, v in custom_env_vars.items():
@@ -211,6 +214,7 @@
     profile_type = MAP_PROFILE[profile_type]
     profile_name = ksu_params.get("profile", {}).get("name")
     age_public_key = ksu_params.get("profile", {}).get("age_pubkey")
+    kustomization_ns = oka_params.get("kustomization_namespace", "flux-system")
     target_ns = oka_params.get("namespace", "default")
     substitute_environment = oka_params.get("substitute_environment", "true").lower()
     custom_env_vars = oka_params.get("custom_env_vars", {})
@@ -218,6 +222,8 @@
         custom_env_vars["APPNAME"] = ksu_name
     if "TARGET_NS" not in custom_env_vars:
         custom_env_vars["TARGET_NS"] = target_ns
+    if "KUSTOMIZATION_NS" not in custom_env_vars:
+        custom_env_vars["KUSTOMIZATION_NS"] = kustomization_ns
     custom_env_vars_str = "|\n"
     substitution_filter_list = []
     for k, v in custom_env_vars.items():