@@ -6329,27 +6329,33 @@ label:"Deployments",
6329
6329
kind:"ReplicationControllers"
6330
6330
}, {
6331
6331
kind:"Builds"
6332
+ }, {
6333
+ kind:"StatefulSets"
6332
6334
} ], c.kindSelector = {
6333
6335
selected:_.find(c.kinds, {
6334
6336
kind:a.kind
6335
6337
}) || _.head(c.kinds)
6336
6338
}, c.logOptions = {
6337
6339
pods:{},
6338
6340
replicationControllers:{},
6339
- builds:{}
6341
+ builds:{},
6342
+ statefulSets:{}
6340
6343
}, c.logCanRun = {
6341
6344
pods:{},
6342
6345
replicationControllers:{},
6343
- builds:{}
6346
+ builds:{},
6347
+ statefulSets:{}
6344
6348
}, c.logEmpty = {
6345
6349
pods:{},
6346
6350
replicationControllers:{},
6347
- builds:{}
6351
+ builds:{},
6352
+ statefulSets:{}
6348
6353
}, c.expanded = {
6349
6354
pods:{},
6350
6355
replicationControllers:{},
6351
6356
replicaSets:{},
6352
- builds:{}
6357
+ builds:{},
6358
+ statefulSets:{}
6353
6359
};
6354
6360
var q = d("isNil");
6355
6361
c.filters = {
@@ -6361,7 +6367,7 @@ k.isAvailable().then(function(a) {
6361
6367
c.metricsAvailable = a;
6362
6368
});
6363
6369
var v = d("orderObjectsByDate"), w = [ "metadata.name" ], x = [], y = function() {
6364
- c.filteredPods = h.filterForKeywords(u, w, x), c.filteredReplicationControllers = h.filterForKeywords(s, w, x), c.filteredReplicaSets = h.filterForKeywords(t, w, x), c.filteredBuilds = h.filterForKeywords(r, w, x);
6370
+ c.filteredPods = h.filterForKeywords(u, w, x), c.filteredReplicationControllers = h.filterForKeywords(s, w, x), c.filteredReplicaSets = h.filterForKeywords(t, w, x), c.filteredBuilds = h.filterForKeywords(r, w, x), c.filteredStatefulSets = h.filterForKeywords(_.values(c.statefulSets), w, x) ;
6365
6371
}, z = function(a) {
6366
6372
c.logOptions.pods[a.metadata.name] = {
6367
6373
container:a.spec.containers[0].name
@@ -6373,22 +6379,24 @@ b && (c.logOptions.replicationControllers[a.metadata.name].version = b), c.logCa
6373
6379
}, B = function(a) {
6374
6380
c.logOptions.builds[a.metadata.name] = {}, c.logCanRun.builds[a.metadata.name] = !_.includes([ "New", "Pending", "Error" ], a.status.phase);
6375
6381
}, C = function() {
6382
+ c.filteredStatefulSets = h.filterForKeywords(_.values(c.statefulSets), w, x);
6383
+ }, D = function() {
6376
6384
u = _.filter(c.pods, function(a) {
6377
6385
return !c.filters.hideOlderResources || "Succeeded" !== a.status.phase && "Failed" !== a.status.phase;
6378
6386
}), c.filteredPods = h.filterForKeywords(u, w, x);
6379
- }, D = d("isIncompleteBuild"), E = d("buildConfigForBuild"), F = d("isRecentBuild"), G = function() {
6387
+ }, E = d("isIncompleteBuild"), F = d("buildConfigForBuild"), G = d("isRecentBuild"), H = function() {
6380
6388
moment().subtract(5, "m");
6381
6389
r = _.filter(c.builds, function(a) {
6382
6390
if (!c.filters.hideOlderResources) return !0;
6383
- if (D (a)) return !0;
6384
- var b = E (a);
6385
- return b ? c.latestBuildByConfig[b].metadata.name === a.metadata.name :F (a);
6391
+ if (E (a)) return !0;
6392
+ var b = F (a);
6393
+ return b ? c.latestBuildByConfig[b].metadata.name === a.metadata.name :G (a);
6386
6394
}), c.filteredBuilds = h.filterForKeywords(r, w, x);
6387
- }, H = d("deploymentStatus"), I = d("deploymentIsInProgress"), J = function() {
6395
+ }, I = d("deploymentStatus"), J = d("deploymentIsInProgress"), K = function() {
6388
6396
s = _.filter(c.replicationControllers, function(a) {
6389
- return !c.filters.hideOlderResources || (I (a) || "Active" === H (a));
6397
+ return !c.filters.hideOlderResources || (J (a) || "Active" === I (a));
6390
6398
}), c.filteredReplicationControllers = h.filterForKeywords(s, w, x);
6391
- }, K = function() {
6399
+ }, L = function() {
6392
6400
t = _.filter(c.replicaSets, function(a) {
6393
6401
return !c.filters.hideOlderResources || _.get(a, "status.replicas");
6394
6402
}), c.filteredReplicaSets = h.filterForKeywords(t, w, x);
@@ -6425,35 +6433,45 @@ break;
6425
6433
6426
6434
case "Pod":
6427
6435
g = !c.expanded.pods[e.metadata.name], c.expanded.pods[e.metadata.name] = g, h = g ? "event.resource.highlight" :"event.resource.clear-highlight", o.$emit(h, e);
6436
+ break;
6437
+
6438
+ case "StatefulSet":
6439
+ g = !c.expanded.statefulSets[e.metadata.name], c.expanded.statefulSets[e.metadata.name] = g, h = g ? "event.resource.highlight" :"event.resource.clear-highlight", o.$emit(h, e);
6428
6440
}
6429
6441
}
6430
6442
}, c.viewPodsForReplicaSet = function(a) {
6431
6443
_.isEmpty(c.podsByOwnerUID[a.metadata.uid]) || l.toPodsForDeployment(a);
6432
6444
};
6433
- var L = function() {
6434
- if (c.pods && c.replicationControllers && c.replicaSets) {
6435
- var a = _.toArray(c.replicationControllers).concat(_.toArray(c.replicaSets));
6445
+ var M = function() {
6446
+ if (c.pods && c.replicationControllers && c.replicaSets && c.statefulSets ) {
6447
+ var a = _.toArray(c.replicationControllers).concat(_.toArray(c.replicaSets)).concat(_.toArray(c.statefulSets)) ;
6436
6448
c.podsByOwnerUID = i.groupBySelector(c.pods, a, {
6437
6449
key:"metadata.uid"
6438
6450
});
6439
6451
}
6440
6452
};
6441
6453
n.get(a.project).then(_.spread(function(a, d) {
6442
6454
c.project = a, c.projectContext = d, f.watch("pods", d, function(a) {
6443
- c.podsByName = a.by("metadata.name"), c.pods = v(c.podsByName, !0), L(), c.podsLoaded = !0, _.each(c.pods, z), C(), j.log("pods", c.pods);
6455
+ c.podsByName = a.by("metadata.name"), c.pods = v(c.podsByName, !0), M(), c.podsLoaded = !0, _.each(c.pods, z), D(), j.log("pods", c.pods);
6456
+ }), f.watch({
6457
+ resource:"statefulsets",
6458
+ group:"apps",
6459
+ version:"v1beta1"
6460
+ }, d, function(a) {
6461
+ c.statefulSets = a.by("metadata.name"), M(), c.statefulSetsLoaded = !0, C(), j.log("statefulSets", c.statefulSets);
6444
6462
}), f.watch("replicationcontrollers", d, function(a) {
6445
- c.replicationControllers = v(a.by("metadata.name"), !0), L (), c.replicationControllersLoaded = !0, _.each(c.replicationControllers, A), J (), j.log("replicationcontrollers", c.replicationControllers);
6463
+ c.replicationControllers = v(a.by("metadata.name"), !0), M (), c.replicationControllersLoaded = !0, _.each(c.replicationControllers, A), K (), j.log("replicationcontrollers", c.replicationControllers);
6446
6464
}), f.watch("builds", d, function(a) {
6447
- c.builds = v(a.by("metadata.name"), !0), c.latestBuildByConfig = e.latestBuildByConfig(c.builds), c.buildsLoaded = !0, _.each(c.builds, B), G (), j.log("builds", c.builds);
6465
+ c.builds = v(a.by("metadata.name"), !0), c.latestBuildByConfig = e.latestBuildByConfig(c.builds), c.buildsLoaded = !0, _.each(c.builds, B), H (), j.log("builds", c.builds);
6448
6466
}), f.watch({
6449
6467
group:"extensions",
6450
6468
resource:"replicasets"
6451
6469
}, d, function(a) {
6452
- c.replicaSets = v(a.by("metadata.name"), !0), L (), c.replicaSetsLoaded = !0, K (), j.log("replicasets", c.replicaSets);
6470
+ c.replicaSets = v(a.by("metadata.name"), !0), M (), c.replicaSetsLoaded = !0, L (), j.log("replicasets", c.replicaSets);
6453
6471
}), c.$on("$destroy", function() {
6454
6472
f.unwatchAll(p);
6455
6473
}), c.$watch("filters.hideOlderResources", function() {
6456
- C (), G (), J (), K ();
6474
+ D (), H (), K (), L(), C ();
6457
6475
var a = b.search();
6458
6476
a.hideOlderResources = c.filters.hideOlderResources ? "true" :"false", b.replace().search(a);
6459
6477
}), c.$watch("kindSelector.selected.kind", function() {
@@ -27171,6 +27189,63 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
27171
27189
"</div>\n" +
27172
27190
"</div>\n" +
27173
27191
"</div>\n" +
27192
+ "<div ng-if=\"kindSelector.selected.kind === 'All' || kindSelector.selected.kind === 'StatefulSets'\">\n" +
27193
+ "<h2>Stateful Sets</h2>\n" +
27194
+ "<div class=\"list-view-pf\">\n" +
27195
+ "<div class=\"list-group-item\" ng-if=\"!(filteredStatefulSets | hashSize)\">\n" +
27196
+ "<div class=\"list-view-pf-main-info\">\n" +
27197
+ "<ellipsis-pulser color=\"dark\" size=\"sm\" msg=\"Loading stateful sets\" ng-if=\"!statefulSetsLoaded\"></ellipsis-pulser>\n" +
27198
+ "<em>\n" +
27199
+ "<div ng-if=\"(statefulSets | hashSize) > 0\">The current filters are hiding all stateful sets.</div>\n" +
27200
+ "<span ng-if=\"statefulSetsLoaded && (statefulSets | hashSize) === 0\">There are no stateful sets in this project.</span>\n" +
27201
+ "</em>\n" +
27202
+ "</div>\n" +
27203
+ "</div>\n" +
27204
+ "<div class=\"list-group-item list-group-item-expandable\" ng-repeat-start=\"set in filteredStatefulSets track by (set | uid)\" ng-click=\"toggleItem($event, this, set)\" ng-class=\"{'expanded': expanded.statefulSets[set.metadata.name]}\">\n" +
27205
+ "<div class=\"list-view-pf-checkbox\">\n" +
27206
+ "<button class=\"sr-only\">{{expanded.statefulSets[set.metadata.name] ? 'Collapse' : 'Expand'}}</button>\n" +
27207
+ "<span ng-if=\"expanded.statefulSets[set.metadata.name]\">\n" +
27208
+ "<span class=\"fa fa-angle-down\"></span>\n" +
27209
+ "</span>\n" +
27210
+ "<span ng-if=\"!expanded.statefulSets[set.metadata.name]\">\n" +
27211
+ "<span class=\"fa fa-angle-right\"></span>\n" +
27212
+ "</span>\n" +
27213
+ "</div>\n" +
27214
+ "<div class=\"list-view-pf-main-info\">\n" +
27215
+ "<div class=\"list-view-pf-body\">\n" +
27216
+ "<div class=\"list-view-pf-description\">\n" +
27217
+ "<div class=\"list-group-item-heading\">\n" +
27218
+ "<a ng-href=\"{{set | navigateResourceURL}}\"><span ng-bind-html=\"set.metadata.name | highlightKeywords : filterKeywords\"></span></a>\n" +
27219
+ "<small>created <span am-time-ago=\"set.metadata.creationTimestamp\"></span></small>\n" +
27220
+ "</div>\n" +
27221
+ "<div class=\"list-group-item-text\">\n" +
27222
+ "<status-icon status=\"set | deploymentStatus\" disable-animation></status-icon>\n" +
27223
+ "{{set | deploymentStatus | sentenceCase}},\n" +
27224
+ "<span ng-if=\"(podsByOwnerUID[set.metadata.uid] | hashSize) !== set.spec.replicas\">{{podsByOwnerUID[set.metadata.uid] | hashSize}}/</span>{{set.spec.replicas}} replica<span ng-if=\"set.spec.replicas != 1\">s</span>\n" +
27225
+ "</div>\n" +
27226
+ "</div>\n" +
27227
+ "<div class=\"list-view-pf-additional-info\">\n" +
27228
+ "<div class=\"list-view-pf-additional-info-item\">\n" +
27229
+ "<span class=\"pficon fa-fw pficon-image\"></span>\n" +
27230
+ "<image-names pod-template=\"set.spec.template\" pods=\"podsByOwnerUID[set.metadata.uid]\"></image-names>\n" +
27231
+ "</div>\n" +
27232
+ "</div>\n" +
27233
+ "</div>\n" +
27234
+ "</div>\n" +
27235
+ "</div>\n" +
27236
+ "<div ng-repeat-end ng-if=\"expanded.statefulSets[set.metadata.name]\" class=\"list-group-expanded-section\" ng-class=\"{'expanded': expanded.statefulSets[set.metadata.name]}\">\n" +
27237
+ "Logs are not available for stateful sets.\n" +
27238
+ "<span ng-if=\"podsByOwnerUID[set.metadata.uid] | hashSize\">\n" +
27239
+ "To see application logs, view the logs for one of the stateful sets's\n" +
27240
+ "<a href=\"\" ng-click=\"viewPodsForReplicaSet(set)\">pods</a>.\n" +
27241
+ "</span>\n" +
27242
+ "<div class=\"mar-top-lg\" ng-if=\"metricsAvailable\">\n" +
27243
+ "<deployment-metrics pods=\"podsByOwnerUID[set.metadata.uid]\" containers=\"set.spec.template.spec.containers\" alerts=\"alerts\">\n" +
27244
+ "</deployment-metrics>\n" +
27245
+ "</div>\n" +
27246
+ "</div>\n" +
27247
+ "</div>\n" +
27248
+ "</div>\n" +
27174
27249
"<div ng-if=\"kindSelector.selected.kind === 'All' || kindSelector.selected.kind === 'Builds'\">\n" +
27175
27250
"<h2>Builds</h2>\n" +
27176
27251
"<div class=\"list-view-pf\">\n" +
0 commit comments