Browse Source

Adding ability to specify image for single commands

DLS version was bumped to 0.5.0

Change-Id: I82e910f11c1033ff24d48087329c46691600699b
Andrey Pavlov 2 years ago
parent
commit
4f697982a9
4 changed files with 12 additions and 4 deletions
  1. 9
    2
      doc/source/dsl.rst
  2. 1
    1
      fuel_ccp/__init__.py
  3. 1
    1
      fuel_ccp/templates.py
  4. 1
    0
      fuel_ccp/validation/service.py

+ 9
- 2
doc/source/dsl.rst View File

@@ -38,6 +38,7 @@ Application definition template
38 38
                         - some-service
39 39
                         - some-other-service
40 40
                     type: single
41
+                    image: some_image
41 42
                     command: /tmp/bootstrap.sh
42 43
                     files:
43 44
                         - bootstrap.sh
@@ -263,9 +264,15 @@ command
263 264
    * - name
264 265
      - Name of the command. Required only for `pre` and `post` with type
265 266
        `single`.
266
-     - --
267
+     -
267 268
      - string
268
-     - --
269
+     -
270
+   * - image
271
+     - Image that will be used to run the command. Can be used only for `pre`
272
+       and `post` with type `single`.
273
+     - false
274
+     - string
275
+     - same as for daemon
269 276
    * - command
270 277
      - --
271 278
      - true

+ 1
- 1
fuel_ccp/__init__.py View File

@@ -17,4 +17,4 @@ import pbr.version
17 17
 
18 18
 version_info = pbr.version.VersionInfo("fuel_ccp")
19 19
 __version__ = version_info.version_string()
20
-dsl_version = "0.4.0"
20
+dsl_version = "0.5.0"

+ 1
- 1
fuel_ccp/templates.py View File

@@ -166,7 +166,7 @@ def serialize_daemon_container_spec(container):
166 166
 def serialize_job_container_spec(container, job):
167 167
     return {
168 168
         "name": job["name"],
169
-        "image": images.image_spec(container["image"]),
169
+        "image": images.image_spec(job.get('image') or container["image"]),
170 170
         "imagePullPolicy": CONF.kubernetes.image_pull_policy,
171 171
         "command": _get_start_cmd(job["name"]),
172 172
         "volumeMounts": serialize_volume_mounts(container, job),

+ 1
- 0
fuel_ccp/validation/service.py View File

@@ -54,6 +54,7 @@ LOCAL_COMMAND_SCHEMA = {
54 54
 SINGLE_COMMAND_SCHEMA = copy.deepcopy(LOCAL_COMMAND_SCHEMA)
55 55
 SINGLE_COMMAND_SCHEMA["required"] = ["name", "command", "type"]
56 56
 SINGLE_COMMAND_SCHEMA["properties"]["type"]["enum"] = ["single"]
57
+SINGLE_COMMAND_SCHEMA["properties"]["image"] = NOT_EMPTY_STRING_SCHEMA
57 58
 
58 59
 COMMAND_SCHEMA = {
59 60
     "type": "object",

Loading…
Cancel
Save