-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dependabot/maven/scalable-core/com.h2datab…
…ase-h2-2.2.220
- Loading branch information
Showing
5 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
scalable-core/src/main/java/link/elastic/scalable/core/resource/kubernetes/log/LogVisit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package link.elastic.scalable.core.resource.kubernetes.log; | ||
|
||
import io.kubernetes.client.PodLogs; | ||
import io.kubernetes.client.openapi.ApiClient; | ||
import io.kubernetes.client.openapi.ApiException; | ||
import io.kubernetes.client.openapi.Configuration; | ||
import io.kubernetes.client.openapi.apis.CoreV1Api; | ||
import io.kubernetes.client.openapi.models.V1Pod; | ||
import io.kubernetes.client.util.Config; | ||
import io.kubernetes.client.util.Streams; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
public class LogVisit { | ||
public static void main(String[] args) throws IOException, ApiException { | ||
ApiClient client = Config.defaultClient(); | ||
Configuration.setDefaultApiClient(client); | ||
CoreV1Api coreApi = new CoreV1Api(client); | ||
|
||
PodLogs logs = new PodLogs(); | ||
V1Pod pod = | ||
coreApi | ||
.listNamespacedPod( | ||
"default", "false", null, null, null, null, null, null, null, null, null) | ||
.getItems() | ||
.get(0); | ||
|
||
InputStream is = logs.streamNamespacedPodLog(pod); | ||
Streams.copy(is, System.out); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
scalable-core/src/main/java/link/elastic/scalable/core/resource/kubernetes/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package link.elastic.scalable.core.resource.kubernetes; |
1 change: 1 addition & 0 deletions
1
scalable-core/src/main/java/link/elastic/scalable/core/resource/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package link.elastic.scalable.core.resource; |