Move image name from location to content field in dockerimage recipes (#8076)

6.19.x
Max Shaposhnik 2018-01-02 10:57:57 +02:00 committed by GitHub
parent e3570c4b1c
commit 5c357bc8b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 62 additions and 46 deletions

View File

@ -29,7 +29,7 @@ exports.listStacksTheeEntries = function () {
'installers': ['org.eclipse.che.exec', 'org.eclipse.che.terminal', 'org.eclipse.che.ws-agent', 'org.eclipse.che.ssh'],
'attributes': {'memoryLimitBytes': '2147483648'}
}
}, 'recipe': {'location': 'codenvy/node', 'type': 'dockerimage'}
}, 'recipe': {'content': 'codenvy/node', 'type': 'dockerimage'}
}
}, 'commands': [], 'projects': [], 'defaultEnv': 'default', 'name': 'default', 'links': []
};

View File

@ -26,7 +26,7 @@ exports.dockerimageStack = function () {
'installers': ['org.eclipse.che.exec', 'org.eclipse.che.terminal', 'org.eclipse.che.ws-agent', 'org.eclipse.che.ssh'],
'attributes': {'memoryLimitBytes': '2147483648'}
}
}, 'recipe': {'location': 'eclipse/node', 'type': 'dockerimage'}
}, 'recipe': {'content': 'eclipse/node', 'type': 'dockerimage'}
}
}, 'commands': [], 'projects': [], 'defaultEnv': 'default', 'name': 'default', 'links': []
};

View File

@ -31,7 +31,7 @@ const buildWorkspacesData = function() {
servers: {},
agents: ['org.eclipse.che.terminal', 'org.eclipse.che.ws-agent', 'org.eclipse.che.ssh', 'org.eclipse.che.exec'],
recipe: {
location: 'eclipse/ubuntu_jdk8',
content: 'eclipse/ubuntu_jdk8',
type: 'dockerimage'
}
}

View File

@ -237,9 +237,9 @@ export class StackValidationService {
}
if (CheRecipeTypes.DOCKERFILE === recipe.type) {
if (angular.isDefined(recipe.location) && !recipe.location) {
if (angular.isDefined(recipe.content) && !recipe.content) {
isValid = false;
errors.push('Unknown recipe location.');
errors.push('Unknown recipe content.');
}
if (!recipe.contentType) {
errors.push('Unknown recipe contentType.');
@ -253,12 +253,12 @@ export class StackValidationService {
errors.push('Unknown recipe contentType.');
}
} else if (CheRecipeTypes.DOCKERIMAGE === recipe.type) {
if (!recipe.location) {
if (!recipe.content) {
isValid = false;
errors.push('Unknown recipe location.');
} else if (recipe.location.length > 256) {
errors.push('Unknown recipe content.');
} else if (recipe.content.length > 256) {
isValid = false;
errors.push('Location length is invalid.');
errors.push('Content length is invalid.');
}
} else if (CheRecipeTypes.OPENSHIFT === recipe.type) {
if (angular.isDefined(recipe.location) && !recipe.location) {

View File

@ -114,7 +114,7 @@ export class WorkspaceSelectStackController {
let type = this.workspaceImportedRecipe.type || 'compose';
if (type === 'dockerimage') {
type = 'dockerfile';
this.recipeScript = 'FROM ' + this.workspaceImportedRecipe.location;
this.recipeScript = 'FROM ' + this.workspaceImportedRecipe.content;
this.tabName = 'stack-authoring';
} else if (angular.isDefined(this.workspaceImportedRecipe.location)) {
this.tabName = 'stack-import';

View File

@ -64,7 +64,7 @@ export class CheFactoryTemplates {
}
},
'recipe': {
'location': 'codenvy/ubuntu_jdk8',
'content': 'codenvy/ubuntu_jdk8',
'type': 'dockerimage'
}
}
@ -125,7 +125,7 @@ export class CheFactoryTemplates {
}
},
'recipe': {
'location': 'codenvy/ubuntu_jdk8',
'content': 'codenvy/ubuntu_jdk8',
'type': 'dockerimage'
}
}

View File

@ -41,7 +41,7 @@ describe('DockerImageEnvironmentManager', () => {
}
}, 'installers': ['ws-agent', 'org.eclipse.che.ws-agent'], 'attributes': {'memoryLimitBytes': '16642998272'}
}
}, 'recipe': {'location': 'codenvy/ubuntu_jdk8', 'type': 'dockerimage'}
}, 'recipe': {'content': 'codenvy/ubuntu_jdk8', 'type': 'dockerimage'}
};
machines = envManager.getMachines(environment);

View File

@ -42,7 +42,7 @@ export class RecipeBuilder {
}
if (cheStructWorkspace.runtime.docker.image) {
return {"contentType": "text/x-dockerfile", "type": "dockerimage", "location": cheStructWorkspace.runtime.docker.image};
return {"contentType": "text/x-dockerfile", "type": "dockerimage", "content": cheStructWorkspace.runtime.docker.image};
} else if (cheStructWorkspace.runtime.docker.content) {
return {
"contentType": "text/x-dockerfile",

View File

@ -235,7 +235,7 @@
}
},
"recipe": {
"location": "eclipse/ubuntu_jdk8",
"content": "eclipse/ubuntu_jdk8",
"type": "dockerimage"
}
}
@ -305,7 +305,7 @@
}
},
"recipe": {
"location": "eclipse/ubuntu_jdk8",
"content": "eclipse/ubuntu_jdk8",
"type": "dockerimage"
}
}
@ -368,7 +368,7 @@
}
},
"recipe": {
"location": "eclipse/ubuntu_android",
"content": "eclipse/ubuntu_android",
"type": "dockerimage"
}
}
@ -439,7 +439,7 @@
}
},
"recipe": {
"location": "eclipse/cpp_gcc",
"content": "eclipse/cpp_gcc",
"type": "dockerimage"
}
}
@ -509,7 +509,7 @@
}
},
"recipe": {
"location": "eclipse/dotnet_core",
"content": "eclipse/dotnet_core",
"type": "dockerimage"
}
}
@ -587,7 +587,7 @@
}
},
"recipe": {
"location": "eclipse/ubuntu_go",
"content": "eclipse/ubuntu_go",
"type": "dockerimage"
}
}
@ -670,7 +670,7 @@
}
},
"recipe": {
"location": "eclipse/hadoop-dev",
"content": "eclipse/hadoop-dev",
"type": "dockerimage"
}
}
@ -760,7 +760,7 @@
}
},
"recipe": {
"location": "eclipse/node",
"content": "eclipse/node",
"type": "dockerimage"
}
}
@ -843,7 +843,7 @@
}
},
"recipe": {
"location": "eclipse/php",
"content": "eclipse/php",
"type": "dockerimage"
}
}
@ -973,7 +973,7 @@
}
},
"recipe": {
"location": "eclipse/php:5.6",
"content": "eclipse/php:5.6",
"type": "dockerimage"
}
}
@ -1084,7 +1084,7 @@
}
},
"recipe": {
"location": "eclipse/ubuntu_python:latest",
"content": "eclipse/ubuntu_python:latest",
"type": "dockerimage"
}
}
@ -1160,7 +1160,7 @@
}
},
"recipe": {
"location": "eclipse/ruby_rails",
"content": "eclipse/ruby_rails",
"type": "dockerimage"
}
}
@ -1228,7 +1228,7 @@
}
},
"recipe": {
"location": "eclipse/debian_jdk8",
"content": "eclipse/debian_jdk8",
"type": "dockerimage"
}
}
@ -1278,7 +1278,7 @@
}
},
"recipe": {
"location": "eclipse/debian_jdk8",
"content": "eclipse/debian_jdk8",
"type": "dockerimage"
}
}
@ -1348,7 +1348,7 @@
}
},
"recipe": {
"location": "eclipse/centos_jdk8",
"content": "eclipse/centos_jdk8",
"type": "dockerimage"
}
}
@ -1424,7 +1424,7 @@
}
},
"recipe": {
"location": "eclipse/debian_jdk8",
"content": "eclipse/debian_jdk8",
"type": "dockerimage"
}
}
@ -1512,7 +1512,7 @@
}
},
"recipe": {
"location": "eclipse/php:gae",
"content": "eclipse/php:gae",
"type": "dockerimage"
}
}
@ -1587,7 +1587,7 @@
}
},
"recipe": {
"location": "eclipse/ubuntu_python:2.7",
"content": "eclipse/ubuntu_python:2.7",
"type": "dockerimage"
}
}
@ -1659,7 +1659,7 @@
}
},
"recipe": {
"location": "eclipse/ubuntu_python:gae_python2.7",
"content": "eclipse/ubuntu_python:gae_python2.7",
"type": "dockerimage"
}
}
@ -1762,7 +1762,7 @@
}
},
"recipe": {
"location": "eclipse/selenium",
"content": "eclipse/selenium",
"type": "dockerimage"
}
}
@ -1827,7 +1827,7 @@
}
},
"recipe": {
"location": "tomitribe/ubuntu_tomee_173_jdk8",
"content": "tomitribe/ubuntu_tomee_173_jdk8",
"type": "dockerimage"
}
}
@ -1878,7 +1878,7 @@
}
},
"recipe": {
"location": "eclipse/ubuntu_jdk8",
"content": "eclipse/ubuntu_jdk8",
"type": "dockerimage"
}
}
@ -1956,7 +1956,7 @@
}
},
"recipe": {
"location": "kaloyanraev/che-zendserver",
"content": "kaloyanraev/che-zendserver",
"type": "dockerimage"
}
}
@ -2073,7 +2073,7 @@
}
},
"recipe": {
"location": "eclipse/platformio:latest",
"content": "eclipse/platformio:latest",
"type": "dockerimage"
}
}
@ -2196,7 +2196,7 @@
}
},
"recipe": {
"location": "registry.centos.org/che-stacks/vertx",
"content": "registry.centos.org/che-stacks/vertx",
"type": "dockerimage"
}
}
@ -2273,7 +2273,7 @@
"environments": {
"default": {
"recipe": {
"location": "registry.centos.org/che-stacks/spring-boot",
"content": "registry.centos.org/che-stacks/spring-boot",
"type": "dockerimage"
},
"machines": {
@ -2371,7 +2371,7 @@
"environments": {
"default": {
"recipe": {
"location": "registry.centos.org/che-stacks/wildfly-swarm",
"content": "registry.centos.org/che-stacks/wildfly-swarm",
"type": "dockerimage"
},
"machines": {
@ -2462,7 +2462,7 @@
"environments": {
"default": {
"recipe": {
"location": "registry.centos.org/che-stacks/centos-nodejs",
"content": "registry.centos.org/che-stacks/centos-nodejs",
"type": "dockerimage"
},
"machines": {
@ -2570,7 +2570,7 @@
}
},
"recipe": {
"location": "eclipse/kotlin",
"content": "eclipse/kotlin",
"type": "dockerimage"
}
}
@ -2624,7 +2624,7 @@
}
},
"recipe": {
"location": "registry.centos.org/che-stacks/centos-go",
"content": "registry.centos.org/che-stacks/centos-go",
"type": "dockerimage"
}
}
@ -2682,7 +2682,7 @@
}
},
"recipe": {
"location": "registry.centos.org/che-stacks/centos-stack-base",
"content": "registry.centos.org/che-stacks/centos-stack-base",
"type": "dockerimage"
}
}
@ -2779,7 +2779,7 @@
}
},
"recipe": {
"location": "registry.centos.org/che-stacks/centos-ceylon-nodejs-dart",
"content": "registry.centos.org/che-stacks/centos-ceylon-nodejs-dart",
"type": "dockerimage"
}
}

View File

@ -0,0 +1,16 @@
--
-- Copyright (c) 2012-2017 Red Hat, Inc.
-- All rights reserved. This program and the accompanying materials
-- are made available under the terms of the Eclipse Public License v1.0
-- which accompanies this distribution, and is available at
-- http://www.eclipse.org/legal/epl-v10.html
--
-- Contributors:
-- Red Hat, Inc. - initial API and implementation
--
--Moving location of 'dockerimage' type recipes into content
UPDATE environment
SET content=location,
location = null
WHERE type = 'dockerimage'