-
Notifications
You must be signed in to change notification settings - Fork 232
add more detail to specific service types #839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add more detail to specific service types #839
Conversation
>{{ingress.ip}}<span ng-if="!$last">, </span></span> | ||
</dd> | ||
<dt ng-if="service.spec.externalIPs.length">External IPs</dt> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we want to add endpoints as well for each service?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the CLI show them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is the output for describing a service
$ oc describe svc/loadbalancer
Name: loadbalancer
Namespace: default
Labels: app=loadbalancer
Selector: app=loadbalancer
Type: LoadBalancer
IP: 172.30.162.207
External IPs: 172.46.160.65
LoadBalancer Ingress: 172.46.160.65
Port: 8080 8080/TCP
NodePort: 8080 30347/TCP
Endpoints: <none>
Session Affinity: None
No events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to run hack/install-deps.sh to get updated dependencies, you have a big diff in your dist files because your deps are out of date
<dt ng-if="resource.status.loadBalancer.ingress.length">Ingress points</dt> | ||
<dd ng-if="resource.status.loadBalancer.ingress.length"> | ||
<span ng-repeat="ingress in resource.status.loadBalancer.ingress" | ||
<dt ng-if="service.status.loadBalancer.ingress.length">Ingress points</dt> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the : character after the labels for consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juanvallejo Do you mind also changing the labels to headline case like "Ingress Points:" while you're in the file? It looks like I missed a few in #805
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind also changing the labels to headline case like "Ingress Points:" while you're in the file?
Sure, will do
>{{ingress.ip}}<span ng-if="!$last">, </span></span> | ||
</dd> | ||
<dt ng-if="service.spec.externalIPs.length">External IPs</dt> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the CLI show them?
what does the output look like when there are endpoints On Mon, Nov 7, 2016 at 1:18 PM, Juan Vallejo [email protected]
|
f30ac7b
to
21aabbd
Compare
|
which are just the IPs of the pods the service is currently sending traffic I feel like a better approach in the console is to show the list of pods On Mon, Nov 7, 2016 at 1:44 PM, Juan Vallejo [email protected]
|
eb360d2
to
7e81227
Compare
@jwforres @spadgett 7e81227 creates a When a service has no routes to display, it reverts to the old behavior of showing <span ng-if="!routesForService.length">
<a ng-href="project/{{project.metadata.name}}/create-route?service={{service.metadata.name}}" ng-if="'routes' | canI : 'create'">Create route</a>
</span> A service page with routes and pods would look like: And a service page with pods that have no endpoints looks like this: |
It feels like the tables need something to separate them, headers or something. Right now it just feels like a wall of tables :) |
I also don't think I would restrict the width on the Route and Pod tables, the only reason we did it on the ports table before was because it looked odd when it stretched the full width |
|
||
watches.push(DataService.watch("pods", context, function(pods) { | ||
var service = $scope.service; | ||
if (!service) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont request the service here. Instead call getPodsForService either way, and that function should just return if the service hasn't been loaded yet. The serviceResolved method should also call getPodsForService, this way if the service loads after the pods the association will still happen.
function getPodsForService(service, pods) { | ||
$scope.podsForService = []; | ||
var ls = new LabelSelector(service.spec.selector); | ||
angular.forEach(pods.by("metadata.name"), function(pod) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of looping over the pods yourself, just do
$scope.podsForService = ls.select(pods);
|
||
watches.push(DataService.watch("endpoints", context, function(endpoints) { | ||
$scope.podsWithEndpoints = {}; | ||
angular.forEach(endpoints.by("metadata.name"), function(endpoint) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
endpoints.by("metadata.name") returns a map of objects indexed by the metadata name, so iterating over that map is wasting cycles, you can do a direct lookup in that map using $routeParams.service.
To follow our code style use _.each when looping over either arrays or hashes.
You don't need to do undefined checks when trying to find JSON subpaths if you use _.get, see the usage below to get targetRef.Kind
var svcEndpoint = endpoints.by("metadata.name")[$routeParams.service];
if (svcEndpoint) {
_.each(svcEndpoint.subsets, function(subset) {
_.each(subset.addresses, function(address) {
if (_.get(address, "targetRef.Kind") === "Pod") {
$scope.podsWithEndpoints[address.targetRef.name] = true;
}
});
});
}
>{{ingress.ip}}<span ng-if="!$last">, </span></span> | ||
</dd> | ||
<dt>Routes:</dt> | ||
<dd> | ||
<dt ng-if="service.spec.externalIPs.length">External IPs:</dt> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use ng-if-start and ng-if-end when you have consecutive sibling nodes checking the same thing. We have some old code that didn't do this but any new code should. Fix up the other instances in here like ingress above and routes below
ng-if-start="service.spec.externalIPs.length"
<dt>Routes:</dt> | ||
<dd> | ||
<dt ng-if="service.spec.externalIPs.length">External IPs:</dt> | ||
<dd ng-if="service.spec.externalIPs.length"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ng-if-end
<routes-table routes="routesForService" services="services" custom-name-header="routesForService[0].kind"></routes-table> | ||
</div> | ||
<div ng-if="podsForService.length" class="table-responsive small service-table"> | ||
<pods-table pods="podsForService" active-pods="podsWithEndpoints" custom-name-header="podsForService[0].kind"></pods-table> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switching to LabelSelector.select is going to return a map, I would just explicitly set custom-name-header to "Pod" and don't worry about trying to use the kind here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jwforres Hm, for some reason even when dealing with podsForService
as a map, it still allows me to select an item by numerical index, so podsForService[0].kind
still returns Pod
in this case.
@@ -15,6 +15,10 @@ | |||
<tr> | |||
<td data-title="Name"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also need customNameHeader here, this is what shows up at mobile screen widths
</tbody> | ||
<tbody ng-repeat="route in routes | orderObjectsByDate : true"> | ||
<tr> | ||
<td data-title="Name"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
customNameHeader
@jwforres Thanks for the feedback! Review comments addressed: |
a38ca01
to
546a661
Compare
@jwforres Here is the pods' table updated to display a |
fe814e1
to
fa24643
Compare
@jwforres @spadgett Here is what the page would look like with all three tables of the same width, and a black-and-white check when a pod is receiving traffic (this is not a commit, just dev-tools): EDIT: updated image to replace "yes" / "no" with checks and x's in the pods' table "receiving traffic" column |
I prefer the 100% width of the ports table, but we might need to center the Suggest just a check or x for receiving traffic without the "yes/no" text. |
@juanvallejo use the text-success class (green) on the check and the text-danger class (red) on the x |
If I see I have pods that aren't receiving traffic I probably want to know why. Is it worth having a help tip next to Receiving Traffic that suggests reasons your pod may not be getting any traffic yet? |
I dunno I actually think i like the ports table shorter, it just doesn't have the content to be full width to me. But I'm starting to wonder if maybe Routes and Pods should be in tabs instead Just throwing ideas out, but what if we tied in the words Incoming and Outgoing somehow? I feel like there isn't enough context here to someone that doesn't understand how the networking works. How do they know that the Routes are saying what hostnames are pushing traffic to this service and how do they know that services send traffic to pods. I feel like this is an opportunity for us to make this page better. cc @ajacobs21e |
Maybe we could have cards similar to the overview page to help display this? |
f1333b3
to
0359c30
Compare
I like the tabs now that I've seen it. Should it be "Routes | Ports | Pods" since that is how the traffic flows? Are tabs missing from the last screenshot because there are none to show? I'd probably keep the tab and have a message like no routes. Maybe we should put a number with the count in the tab title like we do on the membership page. |
It would be especially helpful if we can say exactly why, for instance when status is |
@spadgett Thanks for the feedback. Here is the same page with each tab displaying the number of resources in each. If a tab has none to show, it displays a warning. Empty table Custom messages if pod not receiving traffic Default traffic warning |
Agreed
Tabs within the detail page or tabs between details and events? I am not sure if I like the tabs within tabs. How many rows would we expect each table to have?
As someone that doesn't fully understand networking, this could be helpful. Which word goes where? :) |
How are pods, services, routes, and ports related? Maybe understanding those connections will help me suggest a design. Would a user want to / need to see more than one table at a time to compare data and/or follow the path? |
With only two tables it's ok to leave both tables on the details page with headers "Traffic" and "Pods" |
@spadgett @ajacobs21e @jwforres Thanks again for the feedback. Commit c7b83a2 makes a new A Routes and Node Ports are shown in the same column. If there are no node ports, they are not shown at all. If a service has no routes, but does have ports, the same The |
I think part of what we were saying is that you should not even see "Node
Port" in the header if there are no node ports.
…On Wed, Nov 30, 2016 at 1:55 PM, Juan Vallejo ***@***.***> wrote:
@spadgett <https://github.com/spadgett> @ajacobs21e
<https://github.com/ajacobs21e> @jwforres <https://github.com/jwforres>
Thanks again for the feedback. Commit c3f8c98
<c3f8c98>
makes a new traffic-table directive that combines routes and ports for a
service. Pods are also shown in the same Details tab, rather than in
their own tab.
[image: services-page-dns-to-hostname-learn-more-link-traffic-table]
<https://cloud.githubusercontent.com/assets/3902875/20765842/12802196-b702-11e6-8e5e-1bc283c2ea40.png>
A Learn more link has been added beside the Traffic header that links to Route
Types documentation
<https://docs.openshift.org/latest/architecture/core_concepts/routes.html#route-types>
.
[image: service-page-learn-more-link]
<https://cloud.githubusercontent.com/assets/3902875/20766034/c10d0116-b702-11e6-8d0c-27bfe64d5b55.png>
Routes and Node Ports are shown in the same column. If there are no node
ports, they are not shown at all.
[image: service-page-with-route-and-nodeport]
<https://cloud.githubusercontent.com/assets/3902875/20766421/745171fc-b704-11e6-87d1-6e7753571574.png>
If a service has no routes, but does have ports, the same traffic-table
directive is re-used, with any missing route information set to none.
[image: service-page-with-ports-and-no-routes]
<https://cloud.githubusercontent.com/assets/3902875/20766164/503ef344-b703-11e6-86b4-35637cfa3d6e.png>
[image: service-page-no-routes-or-ports]
<https://cloud.githubusercontent.com/assets/3902875/20766109/16aea9c6-b703-11e6-9b35-7f1ebeb2ad18.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#839 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABZk7f924BlDt6ehQn4zH9jz6JtZJje4ks5rDcargaJpZM4KrdXt>
.
|
c3f8c98
to
c7b83a2
Compare
@@ -62,50 +62,48 @@ | |||
<dd>{{service.spec.type}}</dd> | |||
<dt>IP:</dt> | |||
<dd>{{service.spec.clusterIP}}</dd> | |||
<dt ng-if-start="service.spec.externalName">External Name</dt> | |||
<dd ng-if-end>{{service.spec.externalName}}</dd> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jwforres Added this field to display a service's external name (if any) for the new types of services. https://tcms-openshift.rhcloud.com/case/6047/
PTAL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is external name like a hostname? should this be "External Hostname:"
Either way don't forget the : on the end of the label
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jwforres Thanks, updated it to "External Hostname:", image below:
0d4e584
to
12f08dd
Compare
the footnote should be a lot closer to the bottom of the table. for the
icons are you using fa-fw class to make sure they are a fixed width? the x
and check looks like different sizes.
…On Tue, Dec 6, 2016 at 2:03 PM, Juan Vallejo ***@***.***> wrote:
@jwforres <https://github.com/jwforres> thanks for the feedback. The
traffic and pods tables no longer have the small class name
[image: services-page-bigger-tables-receiving-traffic-tweaks]
<https://cloud.githubusercontent.com/assets/3902875/20938729/296c30d6-bbba-11e6-8ddb-c23c6c60cc9e.png>
The Receiving traffic icon is now an x when a pod is not receiving traffic
[image: services-page-receiving-traffic-max]
<https://cloud.githubusercontent.com/assets/3902875/20938841/8f02f93e-bbba-11e6-9863-6334de517020.png>
and there is now a footnote that links to the routes
<https://docs.openshift.org/latest/architecture/core_concepts/routes.html#route-types>
docs, and services
<https://docs.openshift.org/latest/architecture/core_concepts/pods_and_services.html#services>
docs.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#839 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABZk7Tc30xyNeD0hZKLxA3979sCpQD2Zks5rFbF8gaJpZM4KrdXt>
.
|
@jwforres added support for a "footnote" to the traffic table that decreases its bottom margin to bring it closer: Added the |
cb9421b
to
a5f6916
Compare
@@ -39,11 +39,11 @@ | |||
<td data-title="Age"><span am-time-ago="pod.metadata.creationTimestamp" am-without-suffix="true"></span></td> | |||
<td ng-if="activePods" data-title="Receiving Traffic"> | |||
<span ng-if="activePods[pod.metadata.name]"> | |||
<status-icon status="'Succeeded'" disable-animation></status-icon> | |||
<status-icon fixed-width="true" status="'Succeeded'" disable-animation></status-icon> | |||
</span> | |||
<span ng-if="!activePods[pod.metadata.name]"> | |||
<span data-toggle="popover" data-trigger="hover" data-content="{{podFailureReasons[pod.status.phase] || 'This pod has no endpoints and is not accepting traffic.'}}" style="cursor: help; padding-left: 5px;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think your problem is the padding-left that is on this span, thats what is offsetting this icon compared to the other
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont think the padding is needed, try just removing it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not done reviewing yet, but first chunk of feedback
$scope.portsForRoutes = {}; | ||
var orderedPorts = $filter("orderBy")(service.spec.ports, "port"); | ||
|
||
for(var i = 0; i < routes.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't use for loops, we use _.each for all iteration
_.each(routes, function(route) {
});
var orderedPorts = $filter("orderBy")(service.spec.ports, "port"); | ||
|
||
for(var i = 0; i < routes.length; i++) { | ||
$scope.portsForRoutes[routes[i].metadata.name] = orderedPorts[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block doesn't seem right to me. A route can specify what port it uses. You might have multiple routes targeting the same ports on the service. You might have some service ports that have no route associated with it.
var serviceResolved = function(service, action) { | ||
$scope.loaded = true; | ||
$scope.service = service; | ||
|
||
getPodsForService(service, $scope.pods); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
service and pods are already on the scope, you don't need to pass them into the functions
})); | ||
|
||
watches.push(DataService.watch("pods", context, function(pods) { | ||
$scope.pods = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there shouldn't be any reason for converting the pod map to an array, you also probably have no reason to have all pods on the scope, you only care about the pods for the service from within the view. You can use a local variable to the controller to keep track of the full set of pods.
|
||
watches.push(DataService.watch("endpoints", context, function(endpoints) { | ||
$scope.podsWithEndpoints = {}; | ||
var svcEndpoint = endpoints.by("metadata.name"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would probably just make this a one-liner instead of initializing a variable as a map and then turning it into a singleton
var svcEndpoint = endpoints.by("metadata.name")[$routeParams.service];
@@ -62,50 +62,53 @@ | |||
<dd>{{service.spec.type}}</dd> | |||
<dt>IP:</dt> | |||
<dd>{{service.spec.clusterIP}}</dd> | |||
<dt>Hostname:</dt> | |||
<dd> | |||
{{service.metadata.name + '.' + service.metadata.namespace + '.svc'}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't concatenate when it isn't necessary
{{service.metadata.name}}.{{service.metadata.namespace}}.svc
<span ng-repeat="externalIP in service.spec.externalIPs" | ||
>{{externalIP}}<span ng-if="!$last">, </span></span> | ||
</dd> | ||
<dt ng-if="!routesForService.length">Routes:</dt> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch to ng-if-start
>{{externalIP}}<span ng-if="!$last">, </span></span> | ||
</dd> | ||
<dt ng-if="!routesForService.length">Routes:</dt> | ||
<dd ng-if="!routesForService.length"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ng-if-end
>{{externalIP}}<span ng-if="!$last">, </span></span> | ||
</dd> | ||
<dt ng-if="!routesForService.length">Routes:</dt> | ||
<dd ng-if="!routesForService.length"> | ||
<span ng-if="!routesForService.length"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this if check is unnecessary, the one above it covers this
>{{externalIP}}<span ng-if="!$last">, </span></span> | ||
</dd> | ||
<dt ng-if="!routesForService.length">Routes:</dt> | ||
<dd ng-if="!routesForService.length"> | ||
<span ng-if="!routesForService.length"> | ||
<a ng-href="project/{{project.metadata.name}}/create-route?service={{service.metadata.name}}" ng-if="'routes' | canI : 'create'">Create route</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if user doesn't have access to create routes, this should say <em>none</em>
<traffic-table routes="routesForService" ports="portsForRoutes" services="services" show-node-ports="showNodePorts" custom-name-header="routesForService[0].kind" has-footer="true"></traffic-table> | ||
</div> | ||
Learn more about | ||
<span class="learn-more-inline" style="margin-left:0;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is learn-more-inline actually giving you anything here when you have these links embedded in a sentence? i also don't actually like the external link icon on these links, it looks strange in this context
<a ng-href="{{'services' | helpLink}}" target="_blank"> | ||
services <i class="fa fa-external-link"></i> | ||
</a> | ||
</span>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because you have newlines in the template the .
is going to have whitespace between it and the previous link
<a href="{{pod | navigateResourceURL}}">{{pod.metadata.name}}</a> | ||
<span ng-if="pod | isTroubledPod"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didnt we take this out of the pods table in your other PR
<span ng-if="!activePods[pod.metadata.name]"> | ||
<span data-toggle="popover" data-trigger="hover" data-content="{{podFailureReasons[pod.status.phase] || 'This pod has no endpoints and is not accepting traffic.'}}" style="cursor: help; padding-left: 5px;"> | ||
<span class="fa fa-fw fa-times text-danger" aria-hidden="true" data-toggle="tooltip" style="cursor: help;"></span> | ||
<span class="sr-only">{{pod.status.phase}}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the phase is not the right sr-only content here, this should probably be either "No" or "Not receiving traffic"
@@ -33,6 +37,17 @@ | |||
<td data-title="Ready">{{pod | numContainersReady}}/{{pod.spec.containers.length}}</td> | |||
<td data-title="Restarts">{{pod | numContainerRestarts}}</td> | |||
<td data-title="Age"><span am-time-ago="pod.metadata.creationTimestamp" am-without-suffix="true"></span></td> | |||
<td ng-if="activePods" data-title="Receiving Traffic"> | |||
<span ng-if="activePods[pod.metadata.name]"> | |||
<status-icon fixed-width="true" status="'Succeeded'" disable-animation></status-icon> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using status-icon here is actually going to cause the sr-only text to say "Succeeded" when really it should be something like "Yes"
@@ -0,0 +1,84 @@ | |||
<!-- Table combining routes and ports for a service --> | |||
<table class="table table-bordered table-hover table-mobile" style="{{ hasFooter ? 'margin-bottom:5px;' : ''}}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when i saw hasFooter i expected the footer to actually be part of the directive, not to just change the styles of the table. i would either make the footer part of the directive, or you can use negative margins on the footer.
<thead> | ||
<tr> | ||
<th ng-if="!showNodePorts">{{customNameHeader || 'Route'}}</th> | ||
<th ng-if="showNodePorts">{{customNameHeader || 'Route'}} / Node Port</th> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this will screw up a screen reader making these different <th>
elements, when the content can change dynamically, instead I would probably do
<th>{{customNameHeader || 'Route'}}<span ng-if="showNodePorts"> / Node Port</span></th>
<tbody ng-if="(routes | hashSize) == 0 && (ports | hashSize) == 0"> | ||
<tr><td colspan="7"><em>{{emptyMessage || 'No routes or ports to show'}}</em></td></tr> | ||
</tbody> | ||
<tbody ng-if="(routes | hashSize) > 0"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the route / port iteration and association logic in here isn't right, lets sync up later
</tbody> | ||
<tbody ng-if="(routes | hashSize) > 0"> | ||
<tr ng-repeat="route in routes | orderObjectsByDate : true"> | ||
<td data-title="{{ customNameHeader || 'Route' }}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this data-title needs to match the column header and include / Node Port when the other one does.
b5e6aad
to
fee3da9
Compare
@jwforres thanks for your help and feedback, review comments addressed. Traffic table now shows each route's information for every service port that it reaches. Ports that have no routes linked to them are also displayed "No traffic" icon in the pod's table is now aligned properly |
_.each($scope.service.spec.ports, function(port) { | ||
var reachedByRoute = false; | ||
_.each($scope.routesForService, function(route) { | ||
if(!route.spec.port || route.spec.port.targetPort === port.name || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spadgett you are more familiar with the route / port stuff, can you review this section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks correct.
_.each($scope.routesForService, function(route) { | ||
if(!route.spec.port || route.spec.port.targetPort === port.name || | ||
route.spec.port.targetPort === port.targetPort) { | ||
if(!$scope.portsByRoute[route.metadata.name]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we usually do this if block as a one-liner
$scope.portsByRoute[route.metadata.name] = $scope.portsByRoute[route.metadata.name] || [];
}); | ||
|
||
if(!reachedByRoute) { | ||
if(!$scope.portsByRoute['']) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$scope.portsByRoute[''] = $scope.portsByRoute[''] || [];
|
||
watches.push(DataService.watch("endpoints", context, function(endpoints) { | ||
$scope.podsWithEndpoints = {}; | ||
var svcEndpoint = endpoints.by("metadata.name")[$routeParams.service]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its a nit but you have an extra whitespace after svcEndpoint
@@ -33,6 +34,18 @@ | |||
<td data-title="Ready">{{pod | numContainersReady}}/{{pod.spec.containers.length}}</td> | |||
<td data-title="Restarts">{{pod | numContainerRestarts}}</td> | |||
<td data-title="Age"><span am-time-ago="pod.metadata.creationTimestamp" am-without-suffix="true"></span></td> | |||
<td ng-if="activePods" data-title="Receiving Traffic"> | |||
<span ng-if="activePods[pod.metadata.name]"> | |||
<span class="fa fa-check text-success" aria-hidden="true"></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing fa-fw
</tr> | ||
<tr ng-repeat-end style="display:none;"></tr> | ||
<tr ng-repeat="port in portsByRoute['']"> | ||
<td data-title="{{customNameHeader || 'Route'}}"><span class="text-muted">none</span></td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are missing node port for this case
@jwforres Thanks, review comments addressed. NodePort case is now handled when there are 0 or >0 routes |
@juanvallejo looks good now, can you squash your commits |
Related Trello Card: https://trello.com/c/5dZkZQAX/807-2-details-on-other-service-types-kubernetes-networking This patch adds more detail, such as ingress points, to service types that support these extra fields (LoadBalancer, etc). It also replaces single-line descriptions, for listing routes and pods related to the current service, with route and pod table directives. It adds warning tooltips to the pod table directive to rows displaying pods with no endpoints. This patch further adds an optional field to pod and route directives for setting a custom 'Name' column header value.
c570b50
to
6a6bd16
Compare
Thanks! Done |
[merge] |
Evaluated for origin web console merge up to 6a6bd16 |
Origin Web Console Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_web_console/832/) (Base Commit: 1fb702b) |
Related Trello Card:
https://trello.com/c/5dZkZQAX/807-2-details-on-other-service-types-kubernetes-networking
Fixes openshift/origin#5979
This patch adds more detail, such as ingress points and external IPs, to service types
that support these extra fields (LoadBalancer, etc).
@spadgett @jwforres