Skip to content

Commit 8166d90

Browse files
author
OpenShift Bot
authored
Merge pull request #1744 from spadgett/bind-requester-username
Merged by openshift-bot
2 parents 5912a3a + 3e3bd4b commit 8166d90

File tree

4 files changed

+60
-43
lines changed

4 files changed

+60
-43
lines changed

app/scripts/directives/bindService.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
newestNotReady = instance;
3939
}
4040
});
41-
ctrl.serviceToBind = _.get(newestReady, 'metadata.name') || _.get(newestNotReady, 'metadata.name');
41+
ctrl.serviceToBind = newestReady || newestNotReady;
4242
};
4343

4444
var sortServiceInstances = function() {
@@ -201,14 +201,15 @@
201201
};
202202

203203
ctrl.bindService = function() {
204-
var svcToBind = ctrl.target.kind === 'Instance' ? ctrl.target : ctrl.serviceInstances[ctrl.serviceToBind];
204+
var svcToBind = ctrl.target.kind === 'Instance' ? ctrl.target : ctrl.serviceToBind;
205205
var application = ctrl.bindType === 'application' ? ctrl.appToBind : undefined;
206206

207207
var context = {
208208
namespace: _.get(svcToBind, 'metadata.namespace')
209209
};
210210

211-
BindingService.bindService(context, _.get(svcToBind, 'metadata.name'), application).then(function(binding){
211+
var serviceClass = BindingService.getServiceClassForInstance(svcToBind, ctrl.serviceClasses);
212+
BindingService.bindService(svcToBind, application, serviceClass).then(function(binding){
212213
ctrl.binding = binding;
213214
ctrl.error = null;
214215

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
"angular-moment": "1.0.0",
4747
"angular-utf8-base64": "0.0.5",
4848
"file-saver": "1.3.3",
49-
"origin-web-common": "0.0.36",
50-
"origin-web-catalog": "0.0.23"
49+
"origin-web-common": "0.0.37",
50+
"origin-web-catalog": "0.0.24"
5151
},
5252
"devDependencies": {
5353
"angular-mocks": "1.5.11",

dist/scripts/scripts.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12245,7 +12245,7 @@ var a, b;
1224512245
_.each(l.serviceInstances, function(c) {
1224612246
var d = "True" === _.get(m(c, "Ready"), "status");
1224712247
d && (!a || c.metadata.creationTimestamp > a.metadata.creationTimestamp) && (a = c), d || b && !(c.metadata.creationTimestamp > b.metadata.creationTimestamp) || (b = c);
12248-
}), l.serviceToBind = _.get(a, "metadata.name") || _.get(b, "metadata.name");
12248+
}), l.serviceToBind = a || b;
1224912249
}, o = function() {
1225012250
l.serviceClasses && l.serviceInstances && (l.orderedServiceInstances = _.sortByAll(l.serviceInstances, function(a) {
1225112251
return _.get(l.serviceClasses, [ a.spec.serviceClassName, "osbMetadata", "displayName" ]) || a.spec.serviceClassName;
@@ -12322,10 +12322,10 @@ l.serviceClasses = a.by("metadata.name"), "Instance" === l.target.kind && (l.ser
1232212322
}, l.$onDestroy = function() {
1232312323
e && (e(), e = void 0), f && c.unwatch(f);
1232412324
}, l.bindService = function() {
12325-
var a = "Instance" === l.target.kind ? l.target :l.serviceInstances[l.serviceToBind], b = "application" === l.bindType ? l.appToBind :void 0, e = {
12325+
var a = "Instance" === l.target.kind ? l.target :l.serviceToBind, b = "application" === l.bindType ? l.appToBind :void 0, e = {
1232612326
namespace:_.get(a, "metadata.namespace")
12327-
};
12328-
d.bindService(e, _.get(a, "metadata.name"), b).then(function(a) {
12327+
}, g = d.getServiceClassForInstance(a, l.serviceClasses);
12328+
d.bindService(a, b, g).then(function(a) {
1232912329
l.binding = a, l.error = null, f = c.watchObject(d.bindingResource, _.get(l.binding, "metadata.name"), e, function(a) {
1233012330
l.binding = a;
1233112331
});

0 commit comments

Comments
 (0)