From f4abfc21bbb2fda30876b11abd6d60708dbac23b Mon Sep 17 00:00:00 2001 From: Samuel Padgett Date: Wed, 17 May 2017 09:58:43 -0400 Subject: [PATCH] Bug 1449908 - Group replica sets by owner reference Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1449908 Use owner references to decide if a replica set is owned by a deployment. Change maps to use deployment UID instead of deployment name. This avoids problems when a deployment is deleted and another is created with the same name. --- app/index.html | 1 + app/scripts/controllers/deployment.js | 9 +- app/scripts/controllers/deployments.js | 24 +- app/scripts/controllers/newOverview.js | 46 +- app/scripts/services/ownerReferences.js | 43 ++ app/views/deployments.html | 12 +- app/views/new-overview.html | 16 +- dist/scripts/scripts.js | 679 ++++++++++++------------ dist/scripts/templates.js | 22 +- 9 files changed, 459 insertions(+), 393 deletions(-) create mode 100644 app/scripts/services/ownerReferences.js diff --git a/app/index.html b/app/index.html index a4439065d9..845c39e7c5 100644 --- a/app/index.html +++ b/app/index.html @@ -212,6 +212,7 @@

JavaScript Required

+ diff --git a/app/scripts/controllers/deployment.js b/app/scripts/controllers/deployment.js index d16043479d..0dad6c95f6 100644 --- a/app/scripts/controllers/deployment.js +++ b/app/scripts/controllers/deployment.js @@ -19,6 +19,7 @@ angular.module('openshiftConsole') ImageStreamResolver, ModalsService, Navigate, + OwnerReferencesService, Logger, ProjectsService, StorageService) { @@ -187,16 +188,12 @@ angular.module('openshiftConsole') })); // Watch replica sets for this deployment - // TODO: Use controller ref watches.push(DataService.watch({ group: 'extensions', resource: 'replicasets' }, context, function(replicaSetData) { var replicaSets = replicaSetData.by('metadata.name'); - var deploymentSelector = new LabelSelector(deployment.spec.selector); - replicaSets = _.filter(replicaSets, function(replicaSet) { - return deploymentSelector.covers(new LabelSelector(replicaSet.spec.selector)); - }); + replicaSets = OwnerReferencesService.filterForController(replicaSets, deployment); $scope.inProgressDeployment = _.chain(replicaSets).filter('status.replicas').size() > 1; $scope.replicaSetsForDeployment = DeploymentsService.sortByRevision(replicaSets); })); @@ -207,7 +204,7 @@ angular.module('openshiftConsole') $scope.alerts["load"] = { type: "error", message: e.status === 404 ? "This deployment can not be found, it may have been deleted." : "The deployment details could not be loaded.", - details: e.status === 404 ? "Any remaining deployment history for this deployment will be shown." : "Reason: " + $filter('getErrorDetails')(e) + details: $filter('getErrorDetails')(e) }; } ); diff --git a/app/scripts/controllers/deployments.js b/app/scripts/controllers/deployments.js index df689c66af..1c57fd3ead 100644 --- a/app/scripts/controllers/deployments.js +++ b/app/scripts/controllers/deployments.js @@ -15,8 +15,8 @@ angular.module('openshiftConsole') DataService, DeploymentsService, LabelFilter, - LabelsService, Logger, + OwnerReferencesService, ProjectsService) { $scope.projectName = $routeParams.project; $scope.replicationControllers = {}; @@ -36,24 +36,28 @@ angular.module('openshiftConsole') }); AlertMessageService.clearAlerts(); - var replicaSets, deployments; + var replicaSets, deploymentsByUID; var annotation = $filter('annotation'); var groupReplicaSets = function() { - $scope.replicaSetsByDeployment = LabelsService.groupBySelector(replicaSets, deployments, { matchSelector: true }); - $scope.unfilteredReplicaSets = _.get($scope, ['replicaSetsByDeployment', ''], {}); + if (!replicaSets || !deploymentsByUID) { + return; + } + + $scope.replicaSetsByDeploymentUID = OwnerReferencesService.groupByControllerUID(replicaSets); + $scope.unfilteredReplicaSets = _.get($scope, ['replicaSetsByDeploymentUID', ''], {}); LabelFilter.addLabelSuggestionsFromResources($scope.unfilteredReplicaSets, $scope.labelSuggestions); LabelFilter.setLabelSuggestions($scope.labelSuggestions); $scope.replicaSets = LabelFilter.getLabelSelector().select($scope.unfilteredReplicaSets); - $scope.latestReplicaSetByDeployment = {}; - _.each($scope.replicaSetsByDeployment, function(replicaSets, deploymentName) { - if (!deploymentName) { + $scope.latestReplicaSetByDeploymentUID = {}; + _.each($scope.replicaSetsByDeploymentUID, function(replicaSets, deploymentUID) { + if (!deploymentUID) { return; } - $scope.latestReplicaSetByDeployment[deploymentName] = - DeploymentsService.getActiveReplicaSet(replicaSets, deployments[deploymentName]); + $scope.latestReplicaSetByDeploymentUID[deploymentUID] = + DeploymentsService.getActiveReplicaSet(replicaSets, deploymentsByUID[deploymentUID]); }); }; @@ -139,7 +143,7 @@ angular.module('openshiftConsole') group: "extensions", resource: "deployments" }, context, function(deploymentData) { - deployments = $scope.unfilteredDeployments = deploymentData.by("metadata.name"); + deploymentsByUID = $scope.unfilteredDeployments = deploymentData.by("metadata.uid"); LabelFilter.addLabelSuggestionsFromResources($scope.unfilteredDeployments, $scope.labelSuggestions); LabelFilter.setLabelSuggestions($scope.labelSuggestions); $scope.deployments = LabelFilter.getLabelSelector().select($scope.unfilteredDeployments); diff --git a/app/scripts/controllers/newOverview.js b/app/scripts/controllers/newOverview.js index 2ebcfac734..fdd48bea66 100644 --- a/app/scripts/controllers/newOverview.js +++ b/app/scripts/controllers/newOverview.js @@ -20,6 +20,7 @@ angular.module('openshiftConsole').controller('NewOverviewController', [ 'Logger', 'MetricsService', 'Navigate', + 'OwnerReferencesService', 'ProjectsService', 'ResourceAlertsService', 'RoutesService', @@ -44,6 +45,7 @@ function OverviewController($scope, Logger, MetricsService, Navigate, + OwnerReferencesService, ProjectsService, ResourceAlertsService, RoutesService) { @@ -155,7 +157,7 @@ function OverviewController($scope, var size = function() { return _.size(overview.deploymentConfigs) + _.size(overview.vanillaReplicationControllers) + - _.size(overview.deployments) + + _.size(overview.deploymentsByUID) + _.size(overview.vanillaReplicaSets) + _.size(overview.statefulSets) + _.size(overview.monopods) + @@ -184,7 +186,7 @@ function OverviewController($scope, // Check if we've loaded the top-level items we show on the overview. var loaded = overview.deploymentConfigs && overview.replicationControllers && - overview.deployments && + overview.deploymentsByUID && overview.replicaSets && overview.statefulSets && overview.pods && @@ -292,7 +294,7 @@ function OverviewController($scope, overview.pipelineViewHasOtherResources = !_.isEmpty(overview.deploymentConfigsNoPipeline) || !_.isEmpty(overview.vanillaReplicationControllers) || - !_.isEmpty(overview.deployments) || + !_.isEmpty(overview.deploymentsByUID) || !_.isEmpty(overview.vanillaReplicaSets) || !_.isEmpty(overview.statefulSets) || !_.isEmpty(overview.monopods); @@ -335,7 +337,7 @@ function OverviewController($scope, var updateFilter = function() { overview.filteredDeploymentConfigs = filterItems(overview.deploymentConfigs); overview.filteredReplicationControllers = filterItems(overview.vanillaReplicationControllers); - overview.filteredDeployments = filterItems(overview.deployments); + overview.filteredDeployments = filterItems(overview.deploymentsByUID); overview.filteredReplicaSets = filterItems(overview.vanillaReplicaSets); overview.filteredStatefulSets = filterItems(overview.statefulSets); overview.filteredMonopods = filterItems(overview.monopods); @@ -519,11 +521,11 @@ function OverviewController($scope, // Get the replica sets that are displayed for a deployment. This will return // only the active replica set unless a deployment is in progress. var getVisibleReplicaSets = function(deployment) { - var name = getName(deployment); - if (!name) { + var uid = getUID(deployment); + if (!uid) { return {}; } - return _.get(overview, ['replicaSetsByDeployment', name]); + return _.get(overview, ['replicaSetsByDeploymentUID', uid]); }; // Set warnings for a Kubernetes deployment, including any active replica sets. @@ -546,7 +548,7 @@ function OverviewController($scope, // Update warnings for all Kubernetes deployments. var updateAllDeploymentWarnings = function() { - _.each(overview.deployments, updateDeploymentWarnings); + _.each(overview.deploymentsByUID, updateDeploymentWarnings); }; // Update all pod warnings, indexing the errors by owner UID. @@ -764,28 +766,28 @@ function OverviewController($scope, // Group replica sets by deployment and filter the visible replica sets. var groupReplicaSets = function() { - if (!overview.replicaSets || !overview.deployments) { + if (!overview.replicaSets || !overview.deploymentsByUID) { return; } - overview.replicaSetsByDeployment = LabelsService.groupBySelector(overview.replicaSets, overview.deployments, { matchSelector: true }); - overview.currentByDeployment = {}; + overview.replicaSetsByDeploymentUID = OwnerReferencesService.groupByControllerUID(overview.replicaSets); + overview.currentByDeploymentUID = {}; // Sort the visible replica sets. - _.each(overview.replicaSetsByDeployment, function(replicaSets, deploymentName) { - if (!deploymentName) { + _.each(overview.replicaSetsByDeploymentUID, function(replicaSets, deploymentUID) { + if (!deploymentUID) { return; } - var deployment = overview.deployments[deploymentName]; + var deployment = overview.deploymentsByUID[deploymentUID]; var visibleReplicaSets = _.filter(replicaSets, function(replicaSet) { return isReplicaSetVisible(replicaSet, deployment); }); var ordered = DeploymentsService.sortByRevision(visibleReplicaSets); - overview.replicaSetsByDeployment[deploymentName] = ordered; - overview.currentByDeployment[deploymentName] = _.head(ordered); + overview.replicaSetsByDeploymentUID[deploymentUID] = ordered; + overview.currentByDeploymentUID[deploymentUID] = _.head(ordered); }); - overview.vanillaReplicaSets = _.sortBy(overview.replicaSetsByDeployment[''], 'metadata.name'); + overview.vanillaReplicaSets = _.sortBy(overview.replicaSetsByDeploymentUID[''], 'metadata.name'); // Since the visible replica sets for each deployment have changed, update // the deployment warnings. @@ -833,7 +835,7 @@ function OverviewController($scope, var toUpdate = [ overview.deploymentConfigs, overview.vanillaReplicationControllers, - overview.deployments, + overview.deploymentsByUID, overview.vanillaReplicaSets, overview.statefulSets, overview.monopods @@ -1195,13 +1197,13 @@ function OverviewController($scope, group: "extensions", resource: "deployments" }, context, function(deploymentData) { - overview.deployments = deploymentData.by('metadata.name'); + overview.deploymentsByUID = deploymentData.by('metadata.uid'); groupReplicaSets(); - updateServicesForObjects(overview.deployments); + updateServicesForObjects(overview.deploymentsByUID); updateServicesForObjects(overview.vanillaReplicaSets); - updateLabelSuggestions(overview.deployments); + updateLabelSuggestions(overview.deploymentsByUID); updateFilter(); - Logger.log("deployments (subscribe)", overview.deployments); + Logger.log("deployments (subscribe)", overview.deploymentsByUID); })); watches.push(DataService.watch("builds", context, function(buildData) { diff --git a/app/scripts/services/ownerReferences.js b/app/scripts/services/ownerReferences.js new file mode 100644 index 0000000000..8774e4cc48 --- /dev/null +++ b/app/scripts/services/ownerReferences.js @@ -0,0 +1,43 @@ +'use strict'; + +angular.module("openshiftConsole") + .factory("OwnerReferencesService", function() { + var getOwnerReferences = function(apiObject) { + return _.get(apiObject, 'metadata.ownerReferences'); + }; + + return { + getOwnerReferences: getOwnerReferences, + + groupByControllerUID: function(apiObjects) { + var objectsByControllerUID = {}; + _.each(apiObjects, function(apiObject) { + var hasController = false; + _.each(getOwnerReferences(apiObject), function(ownerRef) { + if (ownerRef.controller) { + hasController = true; + objectsByControllerUID[ownerRef.uid] = objectsByControllerUID[ownerRef.uid] || []; + objectsByControllerUID[ownerRef.uid].push(apiObject); + } + }); + + if (!hasController) { + objectsByControllerUID[''] = objectsByControllerUID[''] || []; + objectsByControllerUID[''].push(apiObject); + } + }); + + return objectsByControllerUID; + }, + + filterForController: function(apiObjects, controller) { + var controllerUID = _.get(controller, 'metadata.uid'); + return _.filter(apiObjects, function(apiObject) { + return _.some(getOwnerReferences(apiObject), { + uid: controllerUID, + controller: true + }); + }); + } + }; + }); diff --git a/app/views/deployments.html b/app/views/deployments.html index 18179c32f7..fe19c6d2ab 100644 --- a/app/views/deployments.html +++ b/app/views/deployments.html @@ -28,7 +28,7 @@

-

Deployment Configurations

+

Deployment Configurations

@@ -113,7 +113,7 @@

Deployment Conf

-
+

Deployments

@@ -138,15 +138,15 @@

Deployments

{{deployment.metadata.name}}
- - {{deployment | lastDeploymentRevision}} + + {{deployment | lastDeploymentRevision}} - + {{deployment | lastDeploymentRevision}} - {{deployment.status.replicas}}/{{deployment.spec.replicas}} replicas + {{deployment.status.replicas}}/{{deployment.spec.replicas}} replicas diff --git a/app/views/new-overview.html b/app/views/new-overview.html index 268d68fe16..34e48b3989 100644 --- a/app/views/new-overview.html +++ b/app/views/new-overview.html @@ -143,8 +143,8 @@

- + Deployment Configs - + Deployments

@@ -197,8 +197,8 @@

Deployments

@@ -324,10 +324,10 @@

Other Resources

state="overview.state"> -1) a.deploymentConfigDeploymentsInProgress[j] = a.deploymentConfigDeploymentsInProgress[j] || {}, a.deploymentConfigDeploymentsInProgress[j][k] = e; else if ("MODIFIED" === d) { var l = b("deploymentStatus")(e); "Complete" !== l && "Failed" !== l || delete a.deploymentConfigDeploymentsInProgress[j][k]; @@ -6474,31 +6495,31 @@ var l = b("deploymentStatus")(e); } else a.deploymentConfigDeploymentsInProgress = f.associateRunningDeploymentToDeploymentConfig(a.replicationControllersByDC); e ? "DELETED" !== d && (e.causes = b("deploymentCauses")(e)) :angular.forEach(a.replicationControllers, function(a) { a.causes = b("deploymentCauses")(a); -}), i.log("replicationControllers (subscribe)", a.replicationControllers); +}), h.log("replicationControllers (subscribe)", a.replicationControllers); })), o.push(e.watch({ group:"extensions", resource:"replicasets" }, d, function(b) { -k = b.by("metadata.name"), n(), i.log("replicasets (subscribe)", a.replicaSets); +k = b.by("metadata.name"), n(), h.log("replicasets (subscribe)", a.replicaSets); })), o.push(e.watch("deploymentconfigs", d, function(b) { -a.unfilteredDeploymentConfigs = b.by("metadata.name"), g.addLabelSuggestionsFromResources(a.unfilteredDeploymentConfigs, a.labelSuggestions), g.setLabelSuggestions(a.labelSuggestions), a.deploymentConfigs = g.getLabelSelector().select(a.unfilteredDeploymentConfigs), a.emptyMessage = "No deployment configurations to show", a.replicationControllersByDC = f.associateDeploymentsToDeploymentConfig(a.replicationControllers, a.deploymentConfigs, !0), a.replicationControllersByDC[""] && (a.unfilteredReplicationControllers = a.replicationControllersByDC[""], a.replicationControllersByDC[""] = g.getLabelSelector().select(a.replicationControllersByDC[""])), h(), i.log("deploymentconfigs (subscribe)", a.deploymentConfigs); +a.unfilteredDeploymentConfigs = b.by("metadata.name"), g.addLabelSuggestionsFromResources(a.unfilteredDeploymentConfigs, a.labelSuggestions), g.setLabelSuggestions(a.labelSuggestions), a.deploymentConfigs = g.getLabelSelector().select(a.unfilteredDeploymentConfigs), a.emptyMessage = "No deployment configurations to show", a.replicationControllersByDC = f.associateDeploymentsToDeploymentConfig(a.replicationControllers, a.deploymentConfigs, !0), a.replicationControllersByDC[""] && (a.unfilteredReplicationControllers = a.replicationControllersByDC[""], a.replicationControllersByDC[""] = g.getLabelSelector().select(a.replicationControllersByDC[""])), i(), h.log("deploymentconfigs (subscribe)", a.deploymentConfigs); })), o.push(e.watch({ group:"extensions", resource:"deployments" }, d, function(b) { -l = a.unfilteredDeployments = b.by("metadata.name"), g.addLabelSuggestionsFromResources(a.unfilteredDeployments, a.labelSuggestions), g.setLabelSuggestions(a.labelSuggestions), a.deployments = g.getLabelSelector().select(a.unfilteredDeployments), n(), i.log("deployments (subscribe)", a.unfilteredDeployments); +l = a.unfilteredDeployments = b.by("metadata.uid"), g.addLabelSuggestionsFromResources(a.unfilteredDeployments, a.labelSuggestions), g.setLabelSuggestions(a.labelSuggestions), a.deployments = g.getLabelSelector().select(a.unfilteredDeployments), n(), h.log("deployments (subscribe)", a.unfilteredDeployments); })), a.showEmptyMessage = function() { return 0 === b("hashSize")(a.replicationControllersByDC) || !(1 !== b("hashSize")(a.replicationControllersByDC) || !a.replicationControllersByDC[""]); }, g.onActiveFiltersChanged(function(b) { a.$apply(function() { -a.deploymentConfigs = b.select(a.unfilteredDeploymentConfigs), a.replicationControllersByDC = f.associateDeploymentsToDeploymentConfig(a.replicationControllers, a.deploymentConfigs, !0), a.replicationControllersByDC[""] && (a.unfilteredReplicationControllers = a.replicationControllersByDC[""], a.replicationControllersByDC[""] = g.getLabelSelector().select(a.replicationControllersByDC[""])), a.deployments = b.select(a.unfilteredDeployments), a.replicaSets = b.select(a.unfilteredReplicaSets), h(); +a.deploymentConfigs = b.select(a.unfilteredDeploymentConfigs), a.replicationControllersByDC = f.associateDeploymentsToDeploymentConfig(a.replicationControllers, a.deploymentConfigs, !0), a.replicationControllersByDC[""] && (a.unfilteredReplicationControllers = a.replicationControllersByDC[""], a.replicationControllersByDC[""] = g.getLabelSelector().select(a.replicationControllersByDC[""])), a.deployments = b.select(a.unfilteredDeployments), a.replicaSets = b.select(a.unfilteredReplicaSets), i(); }); }), a.$on("$destroy", function() { e.unwatchAll(o); }); })); -} ]), angular.module("openshiftConsole").controller("DeploymentController", [ "$scope", "$filter", "$routeParams", "AlertMessageService", "DataService", "DeploymentsService", "EnvironmentService", "HPAService", "ImageStreamResolver", "ModalsService", "Navigate", "Logger", "ProjectsService", "StorageService", function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) { -var o = {}; +} ]), angular.module("openshiftConsole").controller("DeploymentController", [ "$scope", "$filter", "$routeParams", "AlertMessageService", "DataService", "DeploymentsService", "EnvironmentService", "HPAService", "ImageStreamResolver", "ModalsService", "Navigate", "OwnerReferencesService", "Logger", "ProjectsService", "StorageService", function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) { +var p = {}; a.projectName = c.project, a.name = c.deployment, a.forms = {}, a.alerts = {}, a.imagesByDockerReference = {}, a.breadcrumbs = [ { title:"Deployments", link:"project/" + c.project + "/browse/deployments" @@ -6507,11 +6528,11 @@ title:c.deployment } ], a.healthCheckURL = k.healthCheckURL(c.project, "Deployment", c.deployment, "extensions"), d.getAlerts().forEach(function(b) { a.alerts[b.name] = b.data; }), d.clearAlerts(); -var p = !1, q = function(b, c) { -if (!p) { +var q = !1, r = function(b, c) { +if (!q) { if (!a.forms.deploymentEnvVars || a.forms.deploymentEnvVars.$pristine) return void (a.updatedDeployment = g.copyAndNormalize(b)); if (g.isEnvironmentEqual(b, c)) return void (a.updatedDeployment = g.mergeEdits(a.updatedDeployment, b)); -p = !0, a.alerts["env-conflict"] = { +q = !0, a.alerts["env-conflict"] = { type:"warning", message:"The environment variables for the deployment have been updated in the background. Saving your changes may create a conflict or cause loss of data.", links:[ { @@ -6522,17 +6543,17 @@ return a.clearEnvVarUpdates(), !0; } ] }; } -}, r = b("orderByDisplayName"), s = b("getErrorDetails"), t = function(b, c) { +}, s = b("orderByDisplayName"), t = b("getErrorDetails"), u = function(b, c) { a.alerts["from-value-objects"] = { type:"error", message:b, details:c }; -}, u = []; -m.get(c.project).then(_.spread(function(d, k) { +}, v = []; +n.get(c.project).then(_.spread(function(d, k) { a.project = d, a.projectContext = k; -var m, v = {}, w = function() { -h.getHPAWarnings(a.deployment, a.autoscalers, v, d).then(function(b) { +var n, w = {}, x = function() { +h.getHPAWarnings(a.deployment, a.autoscalers, w, d).then(function(b) { a.hpaWarnings = b; }); }; @@ -6540,11 +6561,11 @@ e.get({ group:"extensions", resource:"deployments" }, c.deployment, k).then(function(d) { -a.loaded = !0, a.deployment = d, w(), a.saveEnvVars = function() { -g.compact(a.updatedDeployment), m = e.update({ +a.loaded = !0, a.deployment = d, x(), a.saveEnvVars = function() { +g.compact(a.updatedDeployment), n = e.update({ group:"extensions", resource:"deployments" -}, c.deployment, a.updatedDeployment, k), m.then(function() { +}, c.deployment, a.updatedDeployment, k), n.then(function() { a.alerts.saveEnvSuccess = { type:"success", message:c.deployment + " was updated." @@ -6556,11 +6577,11 @@ message:c.deployment + " was not updated.", details:"Reason: " + b("getErrorDetails")(d) }; })["finally"](function() { -m = null; +n = null; }); }, a.clearEnvVarUpdates = function() { -a.updatedDeployment = g.copyAndNormalize(a.deployment), a.forms.deploymentEnvVars.$setPristine(), p = !1; -}, u.push(e.watchObject({ +a.updatedDeployment = g.copyAndNormalize(a.deployment), a.forms.deploymentEnvVars.$setPristine(), q = !1; +}, v.push(e.watchObject({ group:"extensions", resource:"deployments" }, c.deployment, k, function(b, c) { @@ -6569,51 +6590,49 @@ type:"warning", message:"This deployment has been deleted." }); var d = a.deployment; -a.deployment = b, a.updatingPausedState = !1, w(), q(b, d), m ? m["finally"](function() { -q(b, d); -}) :q(b, d), i.fetchReferencedImageStreamImages([ b.spec.template ], a.imagesByDockerReference, o, k); -})), u.push(e.watch({ +a.deployment = b, a.updatingPausedState = !1, x(), r(b, d), n ? n["finally"](function() { +r(b, d); +}) :r(b, d), i.fetchReferencedImageStreamImages([ b.spec.template ], a.imagesByDockerReference, p, k); +})), v.push(e.watch({ group:"extensions", resource:"replicasets" }, k, function(b) { -var c = b.by("metadata.name"), e = new LabelSelector(d.spec.selector); -c = _.filter(c, function(a) { -return e.covers(new LabelSelector(a.spec.selector)); -}), a.inProgressDeployment = _.chain(c).filter("status.replicas").size() > 1, a.replicaSetsForDeployment = f.sortByRevision(c); +var c = b.by("metadata.name"); +c = l.filterForController(c, d), a.inProgressDeployment = _.chain(c).filter("status.replicas").size() > 1, a.replicaSetsForDeployment = f.sortByRevision(c); })); }, function(c) { a.loaded = !0, a.alerts.load = { type:"error", message:404 === c.status ? "This deployment can not be found, it may have been deleted." :"The deployment details could not be loaded.", -details:404 === c.status ? "Any remaining deployment history for this deployment will be shown." :"Reason: " + b("getErrorDetails")(c) +details:b("getErrorDetails")(c) }; }), e.list("limitranges", k).then(function(a) { -v = a.by("metadata.name"), w(); +w = a.by("metadata.name"), x(); }); -var x = [], y = []; +var y = [], z = []; a.valueFromObjects = [], e.list("configmaps", k, null, { errorNotification:!1 }).then(function(b) { -x = r(b.by("metadata.name")), a.valueFromObjects = x.concat(y); +y = s(b.by("metadata.name")), a.valueFromObjects = y.concat(z); }, function(a) { -403 !== a.code && t("Could not load config maps", s(a)); +403 !== a.code && u("Could not load config maps", t(a)); }), e.list("secrets", k, null, { errorNotification:!1 }).then(function(b) { -y = r(b.by("metadata.name")), a.valueFromObjects = y.concat(x); +z = s(b.by("metadata.name")), a.valueFromObjects = z.concat(y); }, function(a) { -403 !== a.code && t("Could not load secrets", s(a)); -}), u.push(e.watch("imagestreams", k, function(b) { +403 !== a.code && u("Could not load secrets", t(a)); +}), v.push(e.watch("imagestreams", k, function(b) { var c = b.by("metadata.name"); -i.buildDockerRefMapForImageStreams(c, o), a.deployment && i.fetchReferencedImageStreamImages([ a.deployment.spec.template ], a.imagesByDockerReference, o, k), l.log("imagestreams (subscribe)", a.imageStreams); -})), u.push(e.watch({ +i.buildDockerRefMapForImageStreams(c, p), a.deployment && i.fetchReferencedImageStreamImages([ a.deployment.spec.template ], a.imagesByDockerReference, p, k), m.log("imagestreams (subscribe)", a.imageStreams); +})), v.push(e.watch({ group:"autoscaling", resource:"horizontalpodautoscalers", version:"v1" }, k, function(b) { -a.autoscalers = h.filterHPA(b.by("metadata.name"), "Deployment", c.deployment), w(); -})), u.push(e.watch("builds", k, function(b) { -a.builds = b.by("metadata.name"), l.log("builds (subscribe)", a.builds); +a.autoscalers = h.filterHPA(b.by("metadata.name"), "Deployment", c.deployment), x(); +})), v.push(e.watch("builds", k, function(b) { +a.builds = b.by("metadata.name"), m.log("builds (subscribe)", a.builds); })), a.scale = function(c) { var d = function(c) { a.alerts = a.alerts || {}, a.alerts.scale = { @@ -6647,11 +6666,11 @@ message:"An error occurred removing the volume.", details:b("getErrorDetails")(c) }; }, g = function() { -n.removeVolume(a.deployment, c, k).then(_.noop, f); +o.removeVolume(a.deployment, c, k).then(_.noop, f); }; e.then(g); }, a.$on("$destroy", function() { -e.unwatchAll(u); +e.unwatchAll(v); }); })); } ]), angular.module("openshiftConsole").controller("DeploymentConfigController", [ "$scope", "$filter", "$routeParams", "AlertMessageService", "BreadcrumbsService", "DataService", "DeploymentsService", "EnvironmentService", "HPAService", "ImageStreamResolver", "ModalsService", "Navigate", "Logger", "ProjectsService", "StorageService", "LabelFilter", "labelNameFilter", function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) { diff --git a/dist/scripts/templates.js b/dist/scripts/templates.js index 5b7084072a..4867ff658a 100644 --- a/dist/scripts/templates.js +++ b/dist/scripts/templates.js @@ -5382,7 +5382,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "\n" + "
\n" + "
\n" + - "

Deployment Configurations

\n" + + "

Deployment Configurations

\n" + "\n" + "\n" + "\n" + @@ -5467,7 +5467,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "\n" + "\n" + "
\n" + - "
\n" + + "
\n" + "

Deployments

\n" + "\n" + "\n" + @@ -5492,15 +5492,15 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "{{deployment.metadata.name}}\n" + "\n" + "\n" + "\n" + "
\n" + - "\n" + - "{{deployment | lastDeploymentRevision}}\n" + + "\n" + + "{{deployment | lastDeploymentRevision}}\n" + "\n" + - "\n" + + "\n" + "{{deployment | lastDeploymentRevision}}\n" + "\n" + "\n" + - "{{deployment.status.replicas}}/{{deployment.spec.replicas}} replicas\n" + + "{{deployment.status.replicas}}/{{deployment.spec.replicas}} replicas\n" + "\n" + "\n" + @@ -11532,7 +11532,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "
\n" + "\n" + "\n" + - "\n" + + "\n" + "\n" + "\n" + "\n" + @@ -11547,10 +11547,10 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "
\n" + "
\n" + "

\n" + - "\n" + + "\n" + "Deployment Configs\n" + "\n" + - "\n" + + "\n" + "Deployments\n" + "\n" + "

\n" + @@ -11562,7 +11562,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "
\n" + "

Deployments

\n" + "
\n" + - "\n" + + "\n" + "\n" + "
\n" + "
\n" + @@ -11657,7 +11657,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "

Other Resources

\n" + "\n" + "\n" + - "\n" + + "\n" + "\n" + "\n" + "\n" +