From: wahidw Date: Tue, 17 Aug 2021 17:30:38 +0000 (+0000) Subject: RIC-826: Provide support for xapp_name also in the xapp descriptor X-Git-Tag: 0.5.4~4 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=576a7e55d3f1acddba1a252ea6007be280aa6edf;p=ric-plt%2Fappmgr.git RIC-826: Provide support for xapp_name also in the xapp descriptor Signed-off-by: wahidw Change-Id: Ia9e829569d57d159b09f417a9d993090d795db25 --- diff --git a/xapp_orchestrater/dev/xapp_onboarder/xapp_onboarder/helm_controller/xApp_builder.py b/xapp_orchestrater/dev/xapp_onboarder/xapp_onboarder/helm_controller/xApp_builder.py index a9ecf41..8ef252e 100644 --- a/xapp_orchestrater/dev/xapp_onboarder/xapp_onboarder/helm_controller/xApp_builder.py +++ b/xapp_orchestrater/dev/xapp_onboarder/xapp_onboarder/helm_controller/xApp_builder.py @@ -51,16 +51,22 @@ class xApp(): def __init__(self, config_file, schema_file): self.config_file = config_file self.schema_file = schema_file - + + isnamepresent = 0 if 'name' not in self.config_file: - raise xAppError( - "xApp chart name not found. (Caused by: config-file.json does not contain xapp_name attribute.)", 500) + isnamepresent = 1 + if 'xapp_name' not in self.config_file: + raise xAppError( + "xApp chart name not found. (Caused by: config-file.json does not contain xapp_name attribute.)", 500) if 'version' not in self.config_file: raise xAppError( "xApp chart version not found. (Caused by: config-file.json does not contain version attribute.)", 500) - - self.chart_name = self.config_file['name'] + + if isnamepresent == 1: + self.chart_name = self.config_file['xapp_name'] + else: + self.chart_name = self.config_file['name'] self.chart_version = self.config_file['version'] self.configmap_config_json_file = copy.deepcopy(self.config_file) self.chart_workspace_path = settings.CHART_WORKSPACE_PATH + '/' + self.chart_name + '-' + self.chart_version diff --git a/xapp_orchestrater/dev/xapp_onboarder/xapp_onboarder/resources/xapp-std/templates/deployment.yaml b/xapp_orchestrater/dev/xapp_onboarder/xapp_onboarder/resources/xapp-std/templates/deployment.yaml index 3c4c052..0a622f3 100644 --- a/xapp_orchestrater/dev/xapp_onboarder/xapp_onboarder/resources/xapp-std/templates/deployment.yaml +++ b/xapp_orchestrater/dev/xapp_onboarder/xapp_onboarder/resources/xapp-std/templates/deployment.yaml @@ -55,12 +55,14 @@ spec: - name: config-volume configMap: name: {{ include "ricxapp.configmapname" . }}-appconfig + {{- if .Values.controls }} {{- if .Values.controls.fileStorage }} - name: diskwriter hostPath: path: {{ .Values.storage.mountPath }} type: DirectoryOrCreate {{- end }} + {{- end }} containers: {{- $containers := .Values.containers }} {{- $ports := .Values.messaging.ports }} @@ -106,10 +108,12 @@ spec: volumeMounts: - name: config-volume mountPath: {{ .Values.appconfig.path }} + {{- if .Values.controls }} {{- if .Values.controls.fileStorage }} - name: diskwriter mountPath: {{ .Values.storage.mountPath }} {{- end }} + {{- end }} envFrom: - configMapRef: name: {{ include "ricxapp.configmapname" . }}-appenv