浏览代码

curl test

herlanS_ 3 年之前
父节点
当前提交
3a45cbdf22
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/main/kotlin/co/id/datacomsolusindo/ipphonebridge/IpPhoneBridgeApplication.kt

+ 4 - 0
src/main/kotlin/co/id/datacomsolusindo/ipphonebridge/IpPhoneBridgeApplication.kt

@@ -60,6 +60,10 @@ fun main(args: Array<String>) {
     println("token ${System.getenv("KUBE_TOKEN")}")
     println("service_host ${System.getenv("KUBERNETES_SERVICE_HOST")}")
     println("port ${System.getenv("KUBERNETES_PORT_443_TCP_PORT")}")
+
+    val command = "curl -X GET https://${System.getenv("KUBERNETES_SERVICE_HOST")}:${System.getenv("KUBERNETES_PORT_443_TCP_PORT")}/api/v1/namespaces/tm-bridge/pods/${System.getenv("HOSTNAME")}"
+    val process: Process = Runtime.getRuntime().exec(command)
+    println(process.inputStream.readAllBytes())
 }
 
 class Client(