Skip to content

Commit

Permalink
Merge pull request #2169 from spadgett/build-advanced-options
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Sep 26, 2017
2 parents ef5746b + e7f6d90 commit 9a50f87
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 3 additions & 4 deletions app/scripts/services/applicationGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,17 +351,16 @@ angular.module("openshiftConsole")
sourceStrategy: {
from: {
kind: "ImageStreamTag",
name: input.imageName + ":" + input.imageTag
name: input.imageName + ":" + input.imageTag,
namespace: input.namespace
},
env: env
}
},
triggers: triggers
}
};
if(input.namespace) {
bc.spec.strategy.namespace = input.namespace;
}

if (_.get(input, 'buildConfig.secrets.gitSecret[0].name')) {
bc.spec.source.sourceSecret = _.head(input.buildConfig.secrets.gitSecret);
}
Expand Down
5 changes: 3 additions & 2 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1496,15 +1496,16 @@ type: "Source",
sourceStrategy: {
from: {
kind: "ImageStreamTag",
name: e.imageName + ":" + e.imageTag
name: e.imageName + ":" + e.imageTag,
namespace: e.namespace
},
env: n
}
},
triggers: a
}
};
return e.namespace && (l.spec.strategy.namespace = e.namespace), _.get(e, "buildConfig.secrets.gitSecret[0].name") && (l.spec.source.sourceSecret = _.head(e.buildConfig.secrets.gitSecret)), e.buildConfig.contextDir && (l.spec.source.contextDir = e.buildConfig.contextDir), l;
return _.get(e, "buildConfig.secrets.gitSecret[0].name") && (l.spec.source.sourceSecret = _.head(e.buildConfig.secrets.gitSecret)), e.buildConfig.contextDir && (l.spec.source.contextDir = e.buildConfig.contextDir), l;
}, o._generateImageStream = function(e) {
return {
apiVersion: "v1",
Expand Down
4 changes: 3 additions & 1 deletion test/spec/services/applicationGeneratorSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe("ApplicationGenerator", function(){

inputTemplate = {
name: "ruby-hello-world",
namespace: "openshift",
routing: {
include: true,
targetPort: {
Expand Down Expand Up @@ -288,7 +289,8 @@ describe("ApplicationGenerator", function(){
"sourceStrategy" : {
"from": {
"kind": "ImageStreamTag",
"name": "origin-ruby-sample:latest"
"name": "origin-ruby-sample:latest",
"namespace": "openshift"
},
"env": [{
"name": "BUILD_ENV_1",
Expand Down

0 comments on commit 9a50f87

Please sign in to comment.