Skip to content

Commit

Permalink
Bug 1427084 - Fix problem showing project usage for cluster quota
Browse files Browse the repository at this point in the history
Since we switched from a `clusterQuotas` map to a `clusterQuotas` array
for sorting, we incorrectly keyed the `namespaceUsageByClusterQuota` map
by array index instead of namespace. This prevented the project usage
for a cluster quota from displaying.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1427084
  • Loading branch information
spadgett committed Feb 27, 2017
1 parent a941af6 commit 71d4685
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/scripts/controllers/quota.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ angular.module('openshiftConsole')
$scope.clusterQuotas = _.sortBy(quotas.by("metadata.name"), "metadata.name");
$scope.orderedTypesByClusterQuota = orderTypes($scope.clusterQuotas);
$scope.namespaceUsageByClusterQuota = {};
_.each($scope.clusterQuotas, function(quota, quotaName) {
_.each($scope.clusterQuotas, function(quota) {
if (quota.status) {
var namespaceUsage = _.find(quota.status.namespaces, { namespace: $routeParams.project });
$scope.namespaceUsageByClusterQuota[quotaName] = namespaceUsage.status;
$scope.namespaceUsageByClusterQuota[quota.metadata.name] = namespaceUsage.status;
}
});
Logger.log("cluster quotas", $scope.clusterQuotas);
Expand Down
6 changes: 3 additions & 3 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -5268,12 +5268,12 @@ e.get(b.project).then(_.spread(function(a, e) {
c.project = a, d.list("resourcequotas", e, function(a) {
c.quotas = _.sortBy(a.by("metadata.name"), "metadata.name"), c.orderedTypesByQuota = k(c.quotas), f.log("quotas", c.quotas);
}), d.list("appliedclusterresourcequotas", e, function(a) {
c.clusterQuotas = _.sortBy(a.by("metadata.name"), "metadata.name"), c.orderedTypesByClusterQuota = k(c.clusterQuotas), c.namespaceUsageByClusterQuota = {}, _.each(c.clusterQuotas, function(a, d) {
c.clusterQuotas = _.sortBy(a.by("metadata.name"), "metadata.name"), c.orderedTypesByClusterQuota = k(c.clusterQuotas), c.namespaceUsageByClusterQuota = {}, _.each(c.clusterQuotas, function(a) {
if (a.status) {
var e = _.find(a.status.namespaces, {
var d = _.find(a.status.namespaces, {
namespace:b.project
});
c.namespaceUsageByClusterQuota[d] = e.status;
c.namespaceUsageByClusterQuota[a.metadata.name] = d.status;
}
}), f.log("cluster quotas", c.clusterQuotas);
}), d.list("limitranges", e, function(a) {
Expand Down

0 comments on commit 71d4685

Please sign in to comment.