Skip to content

Commit

Permalink
Merge pull request #3131 from spadgett/overview-dc-labels
Browse files Browse the repository at this point in the history
Bug 1717028: Fix edge case evaluating services for deployment config
  • Loading branch information
openshift-merge-robot authored Jun 5, 2019
2 parents e156298 + 7093d2b commit a820396
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/scripts/controllers/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,17 @@ function OverviewController($scope,
var services = [];
var uid = getUID(apiObject);
var podTemplate = getPodTemplate(apiObject);
if (apiObject.kind === 'DeploymentConfig') {
// Include labels automatically added to deployment config pods since
// the service might select them.
podTemplate = _.defaultsDeep({
metadata: {
labels: {
deploymentconfig: apiObject.metadata.name
}
}
}, podTemplate);
}
_.each(selectorsByService, function(selector, serviceName) {
if (selector.matches(podTemplate)) {
services.push(state.allServices[serviceName]);
Expand Down
8 changes: 7 additions & 1 deletion dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,13 @@ B.replicaSetsByDeploymentUID[t] = a, B.currentByDeploymentUID[t] = _.head(a);
}, lt = {}, ut = function(e) {
e && be.allServices && _.each(e, function(e) {
var t = [], n = _e(e), r = G(e);
_.each(lt, function(e, n) {
"DeploymentConfig" === e.kind && (r = _.defaultsDeep({
metadata: {
labels: {
deploymentconfig: e.metadata.name
}
}
}, r)), _.each(lt, function(e, n) {
e.matches(r) && t.push(be.allServices[n]);
}), be.servicesByObjectUID[n] = _.sortBy(t, "metadata.name");
});
Expand Down

0 comments on commit a820396

Please sign in to comment.