Repository: knox
Updated Branches:
  refs/heads/master d7d728c74 -> f51d09e05


KNOX-1581 - YARN v1 UI - Application - Node and logs links broken

Signed-off-by: Kevin Risden <kris...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/f51d09e0
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/f51d09e0
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/f51d09e0

Branch: refs/heads/master
Commit: f51d09e05fc314528573dfe88c2e0cbd96b55ab3
Parents: d7d728c
Author: Kevin Risden <kris...@apache.org>
Authored: Fri Nov 9 15:32:36 2018 -0500
Committer: Kevin Risden <kris...@apache.org>
Committed: Tue Nov 20 13:29:38 2018 -0500

----------------------------------------------------------------------
 .../resources/services/yarnui/2.7.0/rewrite.xml | 42 +++++---------------
 1 file changed, 11 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/f51d09e0/gateway-service-definitions/src/main/resources/services/yarnui/2.7.0/rewrite.xml
----------------------------------------------------------------------
diff --git 
a/gateway-service-definitions/src/main/resources/services/yarnui/2.7.0/rewrite.xml
 
b/gateway-service-definitions/src/main/resources/services/yarnui/2.7.0/rewrite.xml
index cd9d35a..ad6337a 100644
--- 
a/gateway-service-definitions/src/main/resources/services/yarnui/2.7.0/rewrite.xml
+++ 
b/gateway-service-definitions/src/main/resources/services/yarnui/2.7.0/rewrite.xml
@@ -86,23 +86,7 @@
 <rule dir="IN" name="YARNUI/yarn/inbound/logs" 
pattern="*://*:*/**/yarn/logs?{scheme}?{host}?{port}?{**}">
     <rewrite template="{scheme}://{host}:{port}/logs/?{**}"/>
 </rule>
-<rule dir="IN" name="YARNUI/yarn/inbound/jobhistory/job" 
pattern="*://*:*/**/yarn/jobhistory/job/{**}?{scheme}?{host}?{port}">
-    <rewrite template="{scheme}://{host}:{port}/jobhistory/job/{**}"/>
-</rule>
-<rule dir="IN" name="YARNUI/yarn/inbound/jobhistory/params" 
pattern="*://*:*/**/jobstory/jobhistory/{**}?{**}">
-    <rewrite template="{$serviceUrl[JOBSTORYUI]}/jobhistory/{**}?{**}"/>
-</rule>
-<!--
-  This rewrites a META refresh in web page so it will re-direct to jobstory.
--->
-<!--
-<rule dir="OUT" name="YARNUI/yarn/outbound/node/allApplications" 
pattern="/node/allApplications">
-    <rewrite 
template="{$frontend[url]}/yarn/nodemanager/node/node/allApplications?{scheme}?host={$hostmap(host)}?{port}"/>
-</rule>
--->
-<rule dir="OUT" name="YARNUI/yarn/inbound/jobhistory/logs" pattern="*1; 
url=*://*:*/jobhistory/logs/{**}">
-    <rewrite template="1; 
url=/gateway/jobstoryui/jobstory/jobhistory/logs/{**}"/>
-</rule>
+
 <rule dir="OUT" name="YARNUI/yarn/outbound/headers/logs/location">
     <match pattern="{scheme}://{host}:{port}/logs/?{**}"/>
     <rewrite 
template="{$frontend[url]}/yarn/logs?{scheme}?host={$hostmap(host)}?{port}?{**}"/>
@@ -140,7 +124,7 @@
     <rewrite template="{$frontend[url]}/yarn/cluster/scheduler?{**}"/>
 </rule>
 <rule dir="OUT" name="YARNUI/yarn/outbound/node" pattern="/node/{**}">
-    <rewrite template="{$frontend[url]}/yarn/node/{**}"/>
+    <rewrite template="{$frontend[url]}/yarn/nodemanager/node/{**}"/>
 </rule>
 <rule dir="OUT" name="YARNUI/yarn/outbound/cluster/app" 
pattern="*://*:*/cluster/app/{**}">
     <rewrite template="{$frontend[url]}/yarn/cluster/app/{**}"/>
@@ -152,12 +136,12 @@
 <rule dir="OUT" name="YARNUI/yarn/outbound/proxy" pattern="*://*:*/proxy/{**}">
     <rewrite template="{$frontend[url]}/yarn/proxy/{**}"/>
 </rule>
-<rule dir="OUT" name="YARNUI/yarn/outbound/jobhistory/params" 
pattern="/jobhistory/{**}?{**}">
-    <rewrite template="/gateway/jobstoryui/jobstory/jobhistory/{**}?{**}"/>
-</rule>
 <rule flow="OR" dir="OUT" 
name="YARNUI/yarn/outbound/headers/jobhistory/job/location">
-    <match pattern="{scheme}://{host}:{port}/jobhistory/job/{**}">
-        <rewrite 
template="{$frontend[url]}/yarn/jobhistory/job/{**}?{scheme}?{host}?{port}"/>
+    <match pattern="{scheme}://{host}:{port}/jobhistory/logs/{**}">
+        <rewrite 
template="{$frontend[url]}/jobhistory/joblogs/{**}?{scheme}?{host}?{port}"/>
+    </match>
+    <match pattern="{scheme}://{host}:{port}/jobhistory/{**}">
+        <rewrite 
template="{$frontend[url]}/jobhistory/{**}?{scheme}?{host}?{port}"/>
     </match>
     <match pattern="*://*:*/history/{**}?{**}">
         <rewrite template="{$frontend[url]}/sparkhistory/history/{**}?{**}"/>
@@ -174,7 +158,6 @@
     <match pattern="*://*:*/cluster">
         <rewrite template="{$frontend[url]}/yarn/cluster"/>
     </match>
-
 </rule>
 
 <!-- These rules are used for redirection case (302) to  rewrite Location  
header. -->
@@ -271,22 +254,19 @@
 Rule changes
 
href='//${yarn.nodemanager}:{yarn.nodemanager.port}/node/containerlogs/container_xxx/user'
 into'
 
https://knox_host:knox_port/gateway/yarnui/yarn/nodemanager/node/containerlogs/container_XXX/user?host=${yarn.nodemanager.host}&port=${yarn.nodemanager.port}
-
-This is match by inbound "YARNUI/yarn/inbound/jobhistory/logs" rewrite which 
is a client content rewrite
-by adding META refresh. So we need to rewrite META refresh to jobstory.
 -->
 <rule dir="OUT" name="YARNUI/yarn/outbound/node/containerlogs">
     <match pattern="{scheme}://{host}:{port}/node/containerlogs/{**}"/>
-    <rewrite 
template="{gateway.scheme}://{gateway.host}:{gateway.port}/gateway/nodemanagerui/node/containerlogs/{**}?{scheme}?host={$hostmap(host)}?{port}"/>
+    <rewrite 
template="{$frontend[url]}/yarn/nodemanager/node/containerlogs/{**}?{scheme}?host={$hostmap(host)}?{port}"/>
 </rule>
 
 <rule dir="OUT" name="YARNUI/yarn/outbound/node2">
     <match pattern="{scheme}://{host}:{port}"/>
-    <rewrite 
template="{gateway.scheme}://{gateway.host}:{gateway.port}/gateway/nodemanagerui/node?host={host}?port={port}"/>
+    <rewrite 
template="{$frontend[url]}/yarn/nodemanager/node?{scheme}?{host}?{port}"/>
 </rule>
 <rule dir="OUT" name="YARNUI/yarn/outbound/node3">
     <match pattern="//{host}:{port}"/>
-    <rewrite 
template="{gateway.scheme}://{gateway.host}:{gateway.port}/gateway/nodemanagerui/node?host={host}?port={port}"/>
+    <rewrite 
template="{$frontend[url]}/yarn/nodemanager/node?scheme=http?{host}?{port}"/>
 </rule>
 
 <rule dir="OUT" name="YARNUI/yarn/outbound/node/containerlogs2" 
pattern="*://*:*/node/containerlogs/{**}?{**}">
@@ -298,7 +278,7 @@ by adding META refresh. So we need to rewrite META refresh 
to jobstory.
 </rule>
 
 <rule dir="OUT" name="YARNUI/yarn/outbound/nodelink" 
pattern="{scheme}://{host}:{port}">
-    <rewrite 
template="{gateway.scheme}://{gateway.host}:{gateway.port}/gateway/nodemanagerui/node?{host}"/>
+    <rewrite template="{$frontend[url]}/yarn/nodemanager/node?{host}"/>
 </rule>
 
 <rule dir="OUT" name="YARNUI/yarn/outbound/cluster1" 
pattern="*://*:*/cluster/{**}">

Reply via email to