Adding ability to specify image for single commands

DLS version was bumped to 0.5.0

Change-Id: I82e910f11c1033ff24d48087329c46691600699b
This commit is contained in:
Andrey Pavlov 2017-01-11 16:01:12 +03:00
parent 38ca18253e
commit 4f697982a9
4 changed files with 12 additions and 4 deletions

View File

@ -38,6 +38,7 @@ Application definition template
- some-service
- some-other-service
type: single
image: some_image
command: /tmp/bootstrap.sh
files:
- bootstrap.sh
@ -263,9 +264,15 @@ command
* - name
- Name of the command. Required only for `pre` and `post` with type
`single`.
- --
-
- string
- --
-
* - image
- Image that will be used to run the command. Can be used only for `pre`
and `post` with type `single`.
- false
- string
- same as for daemon
* - command
- --
- true

View File

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

View File

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

View File

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