Skip to content

Commit

Permalink
update docker-image-environment-manager
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Kurinnyi <okurinnyi@codenvy.com>
  • Loading branch information
Oleksii Kurinnyi committed Sep 13, 2016
1 parent f9cff54 commit 64f3c9b
Showing 1 changed file with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export class DockerImageEnvironmentManager extends EnvironmentManager {

constructor() {
super();
//TODO define image specific stuff
}

/**
Expand All @@ -33,7 +32,17 @@ export class DockerImageEnvironmentManager extends EnvironmentManager {
* @returns {Array} list of machines defined in environment
*/
getMachines(environment) {
return [];
let machines = [];

Object.keys(environment.machines).forEach((machineName) => {
let machine = angular.copy(environment.machines[machineName]);
machine.name = machineName;
machine.recipe = environment.recipe;

machines.push(machine);
});

return machines;
}

/**
Expand All @@ -44,6 +53,15 @@ export class DockerImageEnvironmentManager extends EnvironmentManager {
* @returns environment's configuration
*/
getEnvironment(environment, machines) {
return {};
return super.getEnvironment(environment, machines);
}
}

/**
* Returns a dockerimage.
*
* @param machine {object}
* @returns {{image: string}}
*/
getSource(machine) {
return {image: machine.recipe.location};
}}

0 comments on commit 64f3c9b

Please sign in to comment.