Skip to content

Commit bae09d0

Browse files
Merge pull request #2369 from jeff-phillips-18/parameters
Automatic merge from submit-queue. Do not allow updating to plans that have been removed Fixes #2316
2 parents 812a86b + 230d98d commit bae09d0

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

app/scripts/controllers/serviceInstance.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,14 @@ angular.module('openshiftConsole')
141141
updateBreadcrumbs();
142142
serviceClassPromise = null;
143143

144-
Catalog.getServicePlans().then(function (plans) {
144+
Catalog.getServicePlansForServiceClass($scope.serviceClass).then(function (plans) {
145145
plans = plans.by('metadata.name');
146146

147-
var plansByServiceClassName = Catalog.groupPlansByServiceClassName(plans);
148-
$scope.servicePlans = plansByServiceClassName[$scope.serviceClass.metadata.name];
149-
150147
var servicePlanName = _.get($scope.serviceInstance, 'spec.clusterServicePlanRef.name');
148+
$scope.servicePlans = _.reject(plans, function(plan) {
149+
return _.get(plan, 'status.removedFromBrokerCatalog') && (plan.metadata.name !== servicePlanName);
150+
});
151+
151152
$scope.plan = plans[servicePlanName];
152153

153154
updateParameterSchema();

dist/scripts/scripts.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -6387,12 +6387,12 @@ e.editAvailable = n && v(e.serviceInstance) && !_.get(e.serviceInstance, "metada
63876387
e.parameterFormDefinition = angular.copy(_.get(e.plan, "spec.externalMetadata.schemas.service_instance.update.openshift_form_definition")), e.parameterSchema = _.get(e.plan, "spec.instanceCreateParameterSchema"), b();
63886388
}, w = function() {
63896389
!e.serviceInstance || e.serviceClass || m || (m = d.fetchServiceClassForInstance(e.serviceInstance).then(function(t) {
6390-
e.serviceClass = t, e.displayName = g(e.serviceInstance, e.serviceClass), y(), m = null, i.getServicePlans().then(function(t) {
6390+
e.serviceClass = t, e.displayName = g(e.serviceInstance, e.serviceClass), y(), m = null, i.getServicePlansForServiceClass(e.serviceClass).then(function(t) {
63916391
t = t.by("metadata.name");
6392-
var n = i.groupPlansByServiceClassName(t);
6393-
e.servicePlans = n[e.serviceClass.metadata.name];
6394-
var a = _.get(e.serviceInstance, "spec.clusterServicePlanRef.name");
6395-
e.plan = t[a], C(), S();
6392+
var n = _.get(e.serviceInstance, "spec.clusterServicePlanRef.name");
6393+
e.servicePlans = _.reject(t, function(e) {
6394+
return _.get(e, "status.removedFromBrokerCatalog") && e.metadata.name !== n;
6395+
}), e.plan = t[n], C(), S();
63966396
});
63976397
}));
63986398
}, k = function(t, n) {

0 commit comments

Comments
 (0)