KNOX-1377 - Ranger service discovery should use policymanager_external_url instead...
authorPhil Zampino <pzampino@apache.org>
Thu, 5 Jul 2018 21:49:30 +0000 (17:49 -0400)
committerPhil Zampino <pzampino@apache.org>
Thu, 5 Jul 2018 21:49:30 +0000 (17:49 -0400)
gateway-discovery-ambari/src/main/resources/ambari-service-discovery-component-config-mapping.properties
gateway-discovery-ambari/src/main/resources/ambari-service-discovery-url-mappings.xml
gateway-discovery-ambari/src/test/java/org/apache/knox/gateway/topology/discovery/ambari/AmbariDynamicServiceURLCreatorTest.java

index 43e8b44..0834888 100644 (file)
@@ -36,7 +36,7 @@ LIVY2_SERVER=livy2-conf
 LOGSEARCH_SERVER=logsearch-properties
 NAMENODE=hdfs-site
 OOZIE_SERVER=oozie-site
-RANGER_ADMIN=ranger-admin-site
+RANGER_ADMIN=admin-properties
 RESOURCEMANAGER=yarn-site
 SPARK_JOBHISTORYSERVER=spark-defaults
 SPARK2_JOBHISTORYSERVER=spark2-defaults
index 8165b79..5609de3 100644 (file)
         <properties>
           <property name="RANGER_EXTERNAL_URL">
             <component>RANGER_ADMIN</component>
-            <config-property>ranger.externalurl</config-property>
+            <config-property>policymgr_external_url</config-property>
           </property>
         </properties>
     </service>
         <properties>
             <property name="RANGER_EXTERNAL_URL">
                 <component>RANGER_ADMIN</component>
-                <config-property>ranger.externalurl</config-property>
+                <config-property>policymgr_external_url</config-property>
             </property>
         </properties>
     </service>
index 554fe88..96d8622 100644 (file)
@@ -912,7 +912,8 @@ public class AmbariDynamicServiceURLCreatorTest {
         EasyMock.expect(rangerAdmin.getConfigProperty("ranger.service.https.attrib.ssl.enabled")).andReturn("false").anyTimes();
         EasyMock.expect(rangerAdmin.getConfigProperty("ranger.service.http.port")).andReturn(HTTP_PORT).anyTimes();
         EasyMock.expect(rangerAdmin.getConfigProperty("ranger.service.https.port")).andReturn(HTTPS_PORT).anyTimes();
-        EasyMock.expect(rangerAdmin.getConfigProperty("ranger.externalurl")).andReturn(EXT_URL).anyTimes();
+        EasyMock.expect(rangerAdmin.getConfigProperty("ranger.externalurl")).andReturn("http://host7:9898").anyTimes();
+        EasyMock.expect(rangerAdmin.getConfigProperty("policymgr_external_url")).andReturn(EXT_URL).anyTimes();
         EasyMock.replay(rangerAdmin);
 
         AmbariCluster cluster = EasyMock.createNiceMock(AmbariCluster.class);
@@ -931,7 +932,8 @@ public class AmbariDynamicServiceURLCreatorTest {
         EasyMock.expect(rangerAdmin.getConfigProperty("ranger.service.https.attrib.ssl.enabled")).andReturn("true").anyTimes();
         EasyMock.expect(rangerAdmin.getConfigProperty("ranger.service.http.port")).andReturn(HTTP_PORT).anyTimes();
         EasyMock.expect(rangerAdmin.getConfigProperty("ranger.service.https.port")).andReturn(HTTPS_PORT).anyTimes();
-        EasyMock.expect(rangerAdmin.getConfigProperty("ranger.externalurl")).andReturn(EXT_URL).anyTimes();
+        EasyMock.expect(rangerAdmin.getConfigProperty("ranger.externalurl")).andReturn("http://host7:9898").anyTimes();
+        EasyMock.expect(rangerAdmin.getConfigProperty("policymgr_external_url")).andReturn(EXT_URL).anyTimes();
         EasyMock.replay(rangerAdmin);
 
         // Run the test, making sure that the external URL is the result