From 278fcd0a8479718955088878af8c9ad11b73003b Mon Sep 17 00:00:00 2001 From: Zhe Date: Wed, 13 May 2020 10:54:39 -0400 Subject: [PATCH] Add a work around for bronze release This commit copies the config.json and schema.json file into the xapp helm chart. This is a work around for bronze release to be backward compatible to the previous xapp standard template. Signed-off-by: Zhe Change-Id: Ia26240ebab0386c505719f9958276c098f0f095f --- ci/xapp_onboarder/container-tag.yaml | 2 +- .../xapp_onboarder/helm_controller/xApp_builder.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ci/xapp_onboarder/container-tag.yaml b/ci/xapp_onboarder/container-tag.yaml index b7b4825..1d95f2d 100644 --- a/ci/xapp_onboarder/container-tag.yaml +++ b/ci/xapp_onboarder/container-tag.yaml @@ -1 +1 @@ -tag: 1.0.0 +tag: 1.0.1 diff --git a/xapp_onboarder/xapp_onboarder/helm_controller/xApp_builder.py b/xapp_onboarder/xapp_onboarder/helm_controller/xApp_builder.py index 0cd821b..1eee2a5 100644 --- a/xapp_onboarder/xapp_onboarder/helm_controller/xApp_builder.py +++ b/xapp_onboarder/xapp_onboarder/helm_controller/xApp_builder.py @@ -145,6 +145,17 @@ class xApp(): outputfile.write(indented_schema_text) +# This is a work around for the bronze release to be backward compatible to the previous xapp standard helm template + def write_config_and_schema(self): + os.makedirs(self.chart_workspace_path + '/' + self.chart_name + '/descriptors') + os.makedirs(self.chart_workspace_path + '/' + self.chart_name + '/config') + with open(self.chart_workspace_path + '/' + self.chart_name + '/descriptors/schema.json', 'w') as outfile: + json.dump(self.schema_file, outfile) + with open(self.chart_workspace_path + '/' + self.chart_name + '/config/config-file.json', 'w') as outfile: + json.dump(self.config_file, outfile) + + + def add_probes_to_deployment(self): with open(self.chart_workspace_path + '/' + self.chart_name + '/templates/deployment.yaml', 'a') as outputfile: @@ -188,6 +199,7 @@ class xApp(): err.stderr.decode("utf-8") + "\n" + err.stdout.decode("utf-8") + ")", 400) def package_chart(self): + self.write_config_and_schema() self.append_config_to_config_map() self.append_config_to_values_yaml() self.add_probes_to_deployment() -- 2.16.6