Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not allow updating to plans that have been removed #2369

Merged
merged 1 commit into from
Oct 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions app/scripts/controllers/serviceInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,14 @@ angular.module('openshiftConsole')
updateBreadcrumbs();
serviceClassPromise = null;

Catalog.getServicePlans().then(function (plans) {
Catalog.getServicePlansForServiceClass($scope.serviceClass).then(function (plans) {
plans = plans.by('metadata.name');

var plansByServiceClassName = Catalog.groupPlansByServiceClassName(plans);
$scope.servicePlans = plansByServiceClassName[$scope.serviceClass.metadata.name];

var servicePlanName = _.get($scope.serviceInstance, 'spec.clusterServicePlanRef.name');
$scope.servicePlans = _.reject(plans, function(plan) {
return _.get(plan, 'status.removedFromBrokerCatalog') && (plan.metadata.name !== servicePlanName);
});

$scope.plan = plans[servicePlanName];

updateParameterSchema();
Expand Down
10 changes: 5 additions & 5 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6387,12 +6387,12 @@ e.editAvailable = n && v(e.serviceInstance) && !_.get(e.serviceInstance, "metada
e.parameterFormDefinition = angular.copy(_.get(e.plan, "spec.externalMetadata.schemas.service_instance.update.openshift_form_definition")), e.parameterSchema = _.get(e.plan, "spec.instanceCreateParameterSchema"), b();
}, w = function() {
!e.serviceInstance || e.serviceClass || m || (m = d.fetchServiceClassForInstance(e.serviceInstance).then(function(t) {
e.serviceClass = t, e.displayName = g(e.serviceInstance, e.serviceClass), y(), m = null, i.getServicePlans().then(function(t) {
e.serviceClass = t, e.displayName = g(e.serviceInstance, e.serviceClass), y(), m = null, i.getServicePlansForServiceClass(e.serviceClass).then(function(t) {
t = t.by("metadata.name");
var n = i.groupPlansByServiceClassName(t);
e.servicePlans = n[e.serviceClass.metadata.name];
var a = _.get(e.serviceInstance, "spec.clusterServicePlanRef.name");
e.plan = t[a], C(), S();
var n = _.get(e.serviceInstance, "spec.clusterServicePlanRef.name");
e.servicePlans = _.reject(t, function(e) {
return _.get(e, "status.removedFromBrokerCatalog") && e.metadata.name !== n;
}), e.plan = t[n], C(), S();
});
}));
}, k = function(t, n) {
Expand Down