Allow containers to speciify command and arguement list 35/3735/3
authorZhe <zhehuang@research.att.com>
Mon, 18 May 2020 18:41:06 +0000 (14:41 -0400)
committerZhe <zhehuang@research.att.com>
Mon, 18 May 2020 18:48:34 +0000 (14:48 -0400)
Signed-off-by: Zhe <zhehuang@research.att.com>
Change-Id: Id8ad6cd78ec5eb73469988de333a892163b83ce6

ci/xapp_onboarder/container-tag.yaml
xapp_onboarder/tests/constants.py
xapp_onboarder/xapp_onboarder/helm_controller/xapp_schema.py
xapp_onboarder/xapp_onboarder/resources/xapp-std/templates/deployment.yaml

index 094595c..9c961bf 100644 (file)
@@ -46,7 +46,8 @@ config_file = {
                 "name": "o-ran-sc/ric-app-mc",
                 "tag": "1.0.2"
             },
-            "command": "/playpen/bin/container_start.sh"
+            "command": ["/bin/sh"],
+            "args": ["-c", "/playpen/bin/container_start.sh"]
         }
     ],
     "livenessProbe": {
index e43f867..0588dfc 100644 (file)
@@ -108,11 +108,32 @@ schema = {
                     },
                     "command": {
                         "$id": "#/properties/containers/items/properties/command",
-                        "type": "string",
-                        "title": "Command To Run The xApp Container",
-                        "default": "command",
-                        "examples": [
-                            "command"
+                        "type": "array",
+                        "items": [
+                            {
+                                "$id": "#/properties/containers/items/properties/command/item",
+                                "type": "string",
+                                "title": "The Command Item",
+                                "default": "/bin/sh",
+                                "examples": [
+                                    "/bin/sh"
+                                ]
+                            }
+                        ]
+                    },
+                    "args": {
+                        "$id": "#/properties/containers/items/properties/args",
+                        "type": "array",
+                        "items": [
+                            {
+                                "$id": "#/properties/containers/items/properties/args/item",
+                                "type": "string",
+                                "title": "The Command Arguement Item",
+                                "default": "-c",
+                                "examples": [
+                                    "-c"
+                                ]
+                            }
                         ]
                     }
                 }
index defb6b4..9d4de1e 100644 (file)
@@ -56,7 +56,24 @@ spec:
         - name: {{ $container.name }}
           image: "{{ $container.image.registry }}/{{ $container.image.name }}:{{ $container.image.tag }}"
           {{- if $container.command }}
-          command: [{{ $container.command }}]
+          command: [
+          {{- range $command := $container.command -}}
+          {{- $command | quote -}}
+          {{- if ne $command (last $container.command) }}
+          {{- print ", " -}}
+          {{- end -}}
+          {{- end -}}
+          {{- print "]" -}}
+          {{- end}}
+          {{- if $container.args }}
+          args: [
+          {{- range $arg := $container.args -}}
+          {{- $arg | quote -}}
+          {{- if ne $arg (last $container.args) }}
+          {{- print ", " -}}
+          {{- end -}}
+          {{- end -}}
+          {{- print "]" -}}
           {{- end}}
           imagePullPolicy: {{ $.Values.image_pull_policy }}
   {{- if $portlist }}