Skip to content

Commit a49febd

Browse files
author
OpenShift Bot
committed
bump(github.com/openshift/origin-web-console): 6fce309ab345f01c60ed1385f7ff6ea15d0b1110
1 parent 6b054c4 commit a49febd

File tree

1 file changed

+57
-52
lines changed

1 file changed

+57
-52
lines changed

pkg/assets/bindata.go

+57-52
Original file line numberDiff line numberDiff line change
@@ -9177,34 +9177,31 @@ link:d.routeURL
91779177
title:"Edit"
91789178
} ], i.get(c.project).then(_.spread(function(i, k) {
91799179
if (d.project = i, d.breadcrumbs[0].title = a("displayName")(i), !f.canI("routes", "update", c.project)) return void h.toErrorPage("You do not have authority to update route " + c.routeName + ".", "access_denied");
9180-
var l, m = a("orderByDisplayName");
9180+
var l, m = a("orderByDisplayName"), n = function() {
9181+
h.toErrorPage('Editing routes with non-service targets is unsupported. You can edit the route with the "Edit YAML" action instead.');
9182+
};
91819183
g.get("routes", d.routeName, k).then(function(a) {
9184+
if ("Service" !== a.spec.to.kind) return void n();
91829185
l = angular.copy(a);
91839186
var b = _.get(l, "spec.host"), c = "Subdomain" === _.get(l, "spec.wildcardPolicy");
91849187
c && (b = "*." + j.getSubdomain(l)), d.routing = {
9185-
service:_.get(l, "spec.to.name"),
91869188
host:b,
91879189
wildcardPolicy:_.get(l, "spec.wildcardPolicy"),
91889190
path:_.get(l, "spec.path"),
91899191
targetPort:_.get(l, "spec.port.targetPort"),
91909192
tls:angular.copy(_.get(l, "spec.tls"))
91919193
}, g.list("services", k).then(function(a) {
9192-
var b = a.by("metadata.name"), c = _.get(l, "spec.to", {});
9193-
d.loading = !1, d.services = m(b), d.routing.to = {
9194-
service:b[c.name],
9195-
weight:c.weight
9196-
}, d.routing.alternateServices = [], _.each(_.get(l, "spec.alternateBackends"), function(a) {
9197-
return "Service" !== a.kind ? (h.toErrorPage('Editing routes with non-service targets is unsupported. You can edit the route with the "Edit YAML" action instead.'), !1) :void d.routing.alternateServices.push({
9198-
service:b[a.name],
9199-
weight:a.weight
9200-
});
9201-
});
9194+
d.loading = !1;
9195+
var b = a.by("metadata.name");
9196+
d.routing.to = l.spec.to, d.routing.alternateServices = [], _.each(_.get(l, "spec.alternateBackends"), function(a) {
9197+
return "Service" !== a.kind ? (n(), !1) :void d.routing.alternateServices.push(a);
9198+
}), d.services = m(b);
92029199
});
92039200
}, function() {
92049201
h.toErrorPage("Could not load route " + d.routeName + ".");
92059202
});
9206-
var n = function() {
9207-
var a = angular.copy(l), b = _.get(d, "routing.to.service.metadata.name");
9203+
var o = function() {
9204+
var a = angular.copy(l), b = _.get(d, "routing.to.name");
92089205
_.set(a, "spec.to.name", b);
92099206
var c = _.get(d, "routing.to.weight");
92109207
isNaN(c) || _.set(a, "spec.to.weight", c), a.spec.path = d.routing.path;
@@ -9214,15 +9211,15 @@ var f = _.get(d, "routing.alternateServices", []);
92149211
return _.isEmpty(f) ? delete a.spec.alternateBackends :a.spec.alternateBackends = _.map(f, function(a) {
92159212
return {
92169213
kind:"Service",
9217-
name:_.get(a, "service.metadata.name"),
9214+
name:a.name,
92189215
weight:a.weight
92199216
};
92209217
}), a;
92219218
};
92229219
d.updateRoute = function() {
92239220
if (d.form.$valid) {
92249221
d.disableInputs = !0;
9225-
var c = n();
9222+
var c = o();
92269223
g.update("routes", d.routeName, c, k).then(function() {
92279224
e.addAlert({
92289225
name:d.routeName,
@@ -10003,10 +10000,12 @@ title:"Create Route"
1000310000
} ], i.get(b.project).then(_.spread(function(i, k) {
1000410001
if (c.project = i, c.breadcrumbs[0].title = a("displayName")(i), !f.canI("routes", "create", b.project)) return void h.toErrorPage("You do not have authority to create routes in project " + b.project + ".", "access_denied");
1000510002
var l = a("orderByDisplayName");
10006-
g.list("services", k).then(function(a) {
10007-
c.services = l(a.by("metadata.name")), c.routing.to = {}, c.routing.to.service = _.find(c.services, function(a) {
10008-
return !c.serviceName || a.metadata.name === c.serviceName;
10009-
});
10003+
c.routing.to = {
10004+
kind:"Service",
10005+
name:c.serviceName,
10006+
weight:1
10007+
}, g.list("services", k).then(function(a) {
10008+
c.services = l(a.by("metadata.name"));
1001010009
}), c.copyServiceLabels = function() {
1001110010
var a = _.get(c, "routing.to.service.metadata.labels", {}), b = j.mapEntries(j.compactEntries(c.labels)), d = _.assign(b, a);
1001210011
c.labels = _.map(d, function(a, b) {
@@ -10018,11 +10017,11 @@ value:a
1001810017
}, c.createRoute = function() {
1001910018
if (c.createRouteForm.$valid) {
1002010019
c.disableInputs = !0;
10021-
var b = c.routing.to.service.metadata.name, f = j.mapEntries(j.compactEntries(c.labels)), h = e.createRoute(c.routing, b, f), i = _.get(c, "routing.alternateServices", []);
10020+
var b = c.routing.to.name, f = j.mapEntries(j.compactEntries(c.labels)), h = e.createRoute(c.routing, b, f), i = _.get(c, "routing.alternateServices", []);
1002210021
_.isEmpty(i) || (h.spec.to.weight = _.get(c, "routing.to.weight"), h.spec.alternateBackends = _.map(i, function(a) {
1002310022
return {
1002410023
kind:"Service",
10025-
name:_.get(a, "service.metadata.name"),
10024+
name:a.name,
1002610025
weight:a.weight
1002710026
};
1002810027
})), g.create("routes", null, h, k).then(function() {
@@ -11300,19 +11299,22 @@ c.routeForm.insecureTraffic.$setValidity("passthrough", a);
1130011299
};
1130111300
c.$watchGroup([ "route.tls.termination", "route.tls.insecureEdgeTerminationPolicy" ], g), c.nameValidation = b, c.disableWildcards ? c.hostnamePattern = b.pattern :c.hostnamePattern = /^(\*(\.[a-z0-9]([-a-z0-9]*[a-z0-9]))+|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$/, c.hostnameMaxLength = b.maxlength;
1130211301
var h = function(a) {
11303-
a && (c.unnamedServicePort = 1 === a.spec.ports.length && !a.spec.ports[0].name, a.spec.ports.length && !c.unnamedServicePort ? c.route.portOptions = _.map(a.spec.ports, function(a) {
11302+
if (a) {
11303+
var b = _.get(a, "spec.ports", []);
11304+
c.unnamedServicePort = 1 === b.length && !b[0].name, b.length && !c.unnamedServicePort ? c.route.portOptions = _.map(b, function(a) {
1130411305
return {
1130511306
port:a.name,
1130611307
label:a.port + " → " + a.targetPort + " (" + a.protocol + ")"
1130711308
};
11308-
}) :c.route.portOptions = []);
11309+
}) :c.route.portOptions = [];
11310+
}
1130911311
};
11310-
c.services && !c.route.service && (c.route.service = _.find(c.services)), c.$watch("route.to.service", function(a, b) {
11311-
h(a), a === b && c.route.targetPort || (c.route.targetPort = _.get(c, "route.portOptions[0].port")), c.services && (c.alternateServiceOptions = _.reject(c.services, function(b) {
11312-
return a === b;
11312+
c.services && !c.route.service && (c.route.service = _.find(c.services)), c.servicesByName, c.services ? c.servicesByName = _.indexBy(c.services, "metadata.name") :c.servicesByName = {}, c.$watch("route.to.name", function(a, b) {
11313+
h(c.servicesByName[a]), a === b && c.route.targetPort || (c.route.targetPort = _.get(c, "route.portOptions[0].port")), c.services && (c.alternateServiceOptions = _.reject(c.services, function(b) {
11314+
return a === b.metadata.name;
1131311315
}));
1131411316
}), c.$watch("route.alternateServices", function(a) {
11315-
c.duplicateServices = _(a).map("service").filter(function(a, b, c) {
11317+
c.duplicateServices = _(a).map("name").filter(function(a, b, c) {
1131611318
return _.includes(c, a, b + 1);
1131711319
}).value(), f.$setValidity("duplicateServices", !c.duplicateServices.length), c.options.alternateServices = !_.isEmpty(a);
1131811320
}, !0);
@@ -11333,12 +11335,12 @@ a !== b && (a || (c.route.alternateServices = []), a && _.isEmpty(c.route.altern
1133311335
}), c.addAlternateService = function() {
1133411336
c.route.alternateServices = c.route.alternateServices || [];
1133511337
var a = _.find(c.services, function(a) {
11336-
return a !== c.route.to.service && !_.some(c.route.alternateServices, {
11337-
service:a
11338+
return a.metadata.name !== c.route.to.service && !_.some(c.route.alternateServices, {
11339+
service:a.metadata.name
1133811340
});
1133911341
});
1134011342
_.has(c, "route.to.weight") || _.set(c, "route.to.weight", 1), c.route.alternateServices.push({
11341-
service:a,
11343+
service:a.metadata.name,
1134211344
weight:1
1134311345
});
1134411346
}, c.weightAsPercentage = function(a, b) {
@@ -11366,20 +11368,18 @@ return {
1136611368
restrict:"E",
1136711369
scope:{
1136811370
model:"=",
11369-
services:"=",
11371+
serviceOptions:"=",
11372+
allServices:"=",
1137011373
isAlternate:"=?",
11371-
showWeight:"=?"
11374+
showWeight:"=?",
11375+
warnUnnamedPort:"=?"
1137211376
},
1137311377
templateUrl:"views/directives/osc-routing-service.html",
1137411378
link:function(a, b, c, d) {
11375-
a.form = d, a.id = _.uniqueId("osc-routing-service-"), a.$watchGroup([ "model.service", "services" ], function() {
11376-
if (!_.isEmpty(a.services)) {
11377-
var b = _.get(a, "model.service");
11378-
if (!b || !_.includes(a.services, b)) {
11379-
var c = _.find(a.services);
11380-
_.set(a, "model.service", c);
11381-
}
11382-
}
11379+
a.form = d, a.id = _.uniqueId("osc-routing-service-"), a.$watchGroup([ "model.name", "serviceOptions" ], function() {
11380+
if (_.isEmpty(a.serviceOptions)) return void (a.optionsNames = []);
11381+
var b = _.get(a, "model.name");
11382+
a.optionNames = [], a.selectedExists = !1, a.optionNames = _.map(a.serviceOptions, "metadata.name"), b && !a.allServices[b] && a.optionNames.push(b), b || _.set(a, "model.name", _.first(a.optionNames));
1138311383
});
1138411384
}
1138511385
};
@@ -23671,10 +23671,10 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
2367123671
"<label for=\"{{id}}-service-select\" class=\"required\">\n" +
2367223672
"Service\n" +
2367323673
"</label>\n" +
23674-
"<ui-select ng-model=\"model.service\" input-id=\"{{id}}-service-select\" aria-describedby=\"{{id}}-service-help\" required>\n" +
23675-
"<ui-select-match>{{$select.selected.metadata.name}}</ui-select-match>\n" +
23676-
"<ui-select-choices repeat=\"service in (services | filter : {metadata: { name: $select.search }}) track by (service | uid)\">\n" +
23677-
"<div ng-bind-html=\"service.metadata.name | highlight : $select.search\"></div>\n" +
23674+
"<ui-select ng-model=\"model.name\" input-id=\"{{id}}-service-select\" aria-describedby=\"{{id}}-service-help\" required>\n" +
23675+
"<ui-select-match>{{$select.selected}}</ui-select-match>\n" +
23676+
"<ui-select-choices repeat=\"serviceName in (optionNames | filter : $select.search)\">\n" +
23677+
"<div ng-bind-html=\"serviceName | highlight : $select.search\"></div>\n" +
2367823678
"</ui-select-choices>\n" +
2367923679
"</ui-select>\n" +
2368023680
"<div>\n" +
@@ -23683,14 +23683,19 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
2368323683
"<span ng-if=\"isAlternate\">Alternate service for route traffic.</span>\n" +
2368423684
"</span>\n" +
2368523685
"</div>\n" +
23686-
"<div ng-if=\"(services | hashSize) === 0\" class=\"has-error\">\n" +
23686+
"<div ng-if=\"model.name && !allServices[model.name]\" class=\"has-warning\">\n" +
23687+
"<span class=\"help-block\">\n" +
23688+
"Service {{model.name}} does not exist.\n" +
23689+
"</span>\n" +
23690+
"</div>\n" +
23691+
"<div ng-if=\"(optionNames | size) === 0\" class=\"has-error\">\n" +
2368723692
"<span class=\"help-block\">\n" +
2368823693
"There are no <span ng-if=\"is-alternate\">additional</span> services in your project to expose with a route.\n" +
2368923694
"</span>\n" +
2369023695
"</div>\n" +
23691-
"<div ng-if=\"unnamedServicePort\" class=\"has-warning\">\n" +
23696+
"<div ng-if=\"warnUnnamedPort\" class=\"has-warning\">\n" +
2369223697
"<span class=\"help-block\">\n" +
23693-
"Service {{route.service.metadata.name}} has a single, unnamed port. A route cannot specifically target an unnamed service port. If more service ports are added later, the route will also direct traffic to them.\n" +
23698+
"Service {{model.name}} has a single, unnamed port. A route cannot specifically target an unnamed service port. If more service ports are added later, the route will also direct traffic to them.\n" +
2369423699
"</span>\n" +
2369523700
"</div>\n" +
2369623701
"</div>\n" +
@@ -23796,7 +23801,7 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
2379623801
"</div>\n" +
2379723802
"\n" +
2379823803
"<div ng-if=\"services\">\n" +
23799-
"<osc-routing-service model=\"route.to\" services=\"services\" show-weight=\"route.alternateServices.length > 1 || (controls.hideSlider && route.alternateServices.length)\">\n" +
23804+
"<osc-routing-service model=\"route.to\" service-options=\"services\" all-services=\"servicesByName\" show-weight=\"route.alternateServices.length > 1 || (controls.hideSlider && route.alternateServices.length)\" warn-unnamed-port=\"unnamedServicePort\">\n" +
2380023805
"</osc-routing-service>\n" +
2380123806
"</div>\n" +
2380223807
"\n" +
@@ -23829,7 +23834,7 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
2382923834
"</div>\n" +
2383023835
"</div>\n" +
2383123836
"<div ng-repeat=\"alternate in route.alternateServices\" class=\"form-group\">\n" +
23832-
"<osc-routing-service model=\"alternate\" services=\"alternateServiceOptions\" is-alternate=\"true\" show-weight=\"route.alternateServices.length > 1 || controls.hideSlider\">\n" +
23837+
"<osc-routing-service model=\"alternate\" service-options=\"alternateServiceOptions\" all-services=\"servicesByName\" is-alternate=\"true\" show-weight=\"route.alternateServices.length > 1 || controls.hideSlider\">\n" +
2383323838
"</osc-routing-service>\n" +
2383423839
"<a href=\"\" ng-click=\"route.alternateServices.splice($index, 1)\">Remove Service</a>\n" +
2383523840
"<span ng-if=\"$last && route.alternateServices.length < alternateServiceOptions.length\">\n" +
@@ -23849,12 +23854,12 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
2384923854
"<div class=\"form-group\">\n" +
2385023855
"<div class=\"weight-slider-values\">\n" +
2385123856
"<div>\n" +
23852-
"<span class=\"service-name\">{{route.to.service.metadata.name}}</span>\n" +
23857+
"<span class=\"service-name\">{{route.to.name}}</span>\n" +
2385323858
"<span class=\"weight-percentage\">{{weightAsPercentage(route.to.weight, true)}}</span>\n" +
2385423859
"</div>\n" +
2385523860
"<div>\n" +
2385623861
"<span class=\"weight-percentage hidden-xs\">{{weightAsPercentage(route.alternateServices[0].weight, true)}}</span>\n" +
23857-
"<span class=\"service-name\">{{route.alternateServices[0].service.metadata.name}}</span>\n" +
23862+
"<span class=\"service-name\">{{route.alternateServices[0].name}}</span>\n" +
2385823863
"<span class=\"weight-percentage visible-xs-inline\">{{weightAsPercentage(route.alternateServices[0].weight, true)}}</span>\n" +
2385923864
"</div>\n" +
2386023865
"</div>\n" +

0 commit comments

Comments
 (0)