@@ -1075,20 +1075,9 @@ public static boolean checkApplicationRuntime(
1075
1075
private static String readRuntimeResource (String adminSvcExtHost , String domainNamespace ,
1076
1076
String adminServerPodName , String resourcePath , String callerName ) {
1077
1077
LoggingFacade logger = getLogger ();
1078
- String result = null ;
1079
- String curlString = null ;
1080
- if (OKE_CLUSTER_PRIVATEIP ) {
1081
- String protocol = "http" ;
1082
- String port = "7001" ;
1078
+ String returnString = null ;
1083
1079
1084
- curlString = String .format (
1085
- KUBERNETES_CLI + " exec -n " + domainNamespace + " " + adminServerPodName + " -- curl -g -k %s://"
1086
- + ADMIN_USERNAME_DEFAULT
1087
- + ":"
1088
- + ADMIN_PASSWORD_DEFAULT
1089
- + "@" + adminServerPodName + ":%s/%s" , protocol , port , resourcePath );
1090
- curlString = curlString + " --silent --show-error " ;
1091
- } else if (TestConstants .KIND_CLUSTER
1080
+ if (TestConstants .KIND_CLUSTER
1092
1081
&& !TestConstants .WLSIMG_BUILDER .equals (TestConstants .WLSIMG_BUILDER_DEFAULT )) {
1093
1082
int port = getServicePort (domainNamespace , adminServerPodName , "internal-t3" );
1094
1083
String domainName = adminServerPodName .split ("-" + ADMIN_SERVER_NAME_BASE )[0 ];
@@ -1114,36 +1103,51 @@ private static String readRuntimeResource(String adminSvcExtHost, String domainN
1114
1103
try {
1115
1104
response = OracleHttpClient .get (url , headers , true );
1116
1105
assertEquals (200 , response .statusCode ());
1117
- return response .body ();
1106
+ returnString = response .body ();
1118
1107
} catch (Exception ex ) {
1119
- return null ;
1108
+ ex . printStackTrace () ;
1120
1109
}
1121
- }
1122
- int adminServiceNodePort
1123
- = getServiceNodePort (domainNamespace , getExternalServicePodName (adminServerPodName ), "default" );
1124
- String host = K8S_NODEPORT_HOST ;
1125
- if (host .contains (":" )) {
1126
- host = "[" + host + "]" ;
1127
- }
1128
- String hostAndPort = (OKD ) ? adminSvcExtHost : host + ":" + adminServiceNodePort ;
1129
- logger .info ("hostAndPort = {0} " , hostAndPort );
1110
+ } else {
1111
+ String curlString = null ;
1112
+ if (OKE_CLUSTER_PRIVATEIP ) {
1113
+ String protocol = "http" ;
1114
+ String port = "7001" ;
1115
+
1116
+ curlString = String .format (
1117
+ KUBERNETES_CLI + " exec -n " + domainNamespace + " " + adminServerPodName + " -- curl -g -k %s://"
1118
+ + ADMIN_USERNAME_DEFAULT
1119
+ + ":"
1120
+ + ADMIN_PASSWORD_DEFAULT
1121
+ + "@" + adminServerPodName + ":%s/%s" , protocol , port , resourcePath );
1122
+ curlString = curlString + " --silent --show-error " ;
1123
+ } else {
1124
+ int adminServiceNodePort
1125
+ = getServiceNodePort (domainNamespace , getExternalServicePodName (adminServerPodName ), "default" );
1126
+ String host = K8S_NODEPORT_HOST ;
1127
+ if (host .contains (":" )) {
1128
+ host = "[" + host + "]" ;
1129
+ }
1130
+ String hostAndPort = (OKD ) ? adminSvcExtHost : host + ":" + adminServiceNodePort ;
1131
+ logger .info ("hostAndPort = {0} " , hostAndPort );
1130
1132
1131
- curlString = String .format (
1132
- "curl -g --user "
1133
- + ADMIN_USERNAME_DEFAULT
1134
- + ":"
1135
- + ADMIN_PASSWORD_DEFAULT
1136
- + " http://%s%s/ --silent --show-error " , hostAndPort , resourcePath );
1133
+ curlString = String .format ("curl -g --user "
1134
+ + ADMIN_USERNAME_DEFAULT
1135
+ + ":"
1136
+ + ADMIN_PASSWORD_DEFAULT
1137
+ + " http://%s%s/ --silent --show-error " , hostAndPort , resourcePath );
1138
+ }
1139
+ logger .info (callerName + ": curl command {0}" , curlString );
1137
1140
1138
- logger . info ( callerName + ": curl command {0}" , curlString );
1139
- try {
1140
- result = exec ( curlString , true ). stdout ( );
1141
- logger . info ( callerName + ": exec curl command {0} got: {1}" , curlString , result ) ;
1142
- } catch (Exception ex ) {
1143
- logger .info (callerName + ": caught unexpected exception {0}" , ex );
1144
- return null ;
1141
+ try {
1142
+ String result = exec ( curlString , true ). stdout ();
1143
+ logger . info ( callerName + ": exec curl command {0} got: {1}" , curlString , result );
1144
+ returnString = result ;
1145
+ } catch (Exception ex ) {
1146
+ logger .info (callerName + ": caught unexpected exception {0}" , ex );
1147
+ }
1145
1148
}
1146
- return result ;
1149
+
1150
+ return returnString ;
1147
1151
}
1148
1152
1149
1153
/**
0 commit comments