|
|
@@ -93,18 +93,18 @@ public class DeploymentApiImplTest {
|
|
|
|
|
|
deploymentApi.createSync(deployment);
|
|
|
|
|
|
- try {
|
|
|
- Watch<V1Pod> watch = Watch.createWatch(watchApiClient,
|
|
|
- new CoreV1Api(watchApiClient).listNamespacedPodCall("demo2", null, null, null, null, "demo.seec.nju.cn/app=test", null, null, null, true, null, null ),
|
|
|
- new TypeToken<Watch.Response<V1Pod>>(){}.getType());
|
|
|
- watch.forEach(response -> {
|
|
|
- System.out.printf("%s pod : %s %s%n", response.type, response.object.getMetadata().getName(), response.object.getStatus());
|
|
|
- });
|
|
|
- } catch (ApiException e) {
|
|
|
- System.out.println(e.getResponseBody());
|
|
|
- } catch (Exception e) {
|
|
|
- System.out.println(e);
|
|
|
- }
|
|
|
+// try {
|
|
|
+// Watch<V1Pod> watch = Watch.createWatch(watchApiClient,
|
|
|
+// new CoreV1Api(watchApiClient).listNamespacedPodCall("demo2", null, null, null, null, "demo.seec.nju.cn/app=test", null, null, null, true, null, null ),
|
|
|
+// new TypeToken<Watch.Response<V1Pod>>(){}.getType());
|
|
|
+// watch.forEach(response -> {
|
|
|
+// System.out.printf("%s pod : %s %s%n", response.type, response.object.getMetadata().getName(), response.object.getStatus());
|
|
|
+// });
|
|
|
+// } catch (ApiException e) {
|
|
|
+// System.out.println(e.getResponseBody());
|
|
|
+// } catch (Exception e) {
|
|
|
+// System.out.println(e);
|
|
|
+// }
|
|
|
|
|
|
|
|
|
}
|
|
|
@@ -126,7 +126,7 @@ public class DeploymentApiImplTest {
|
|
|
|
|
|
@Test
|
|
|
public void testDelete() {
|
|
|
- deploymentApi.delete("demo", "test");
|
|
|
+ deploymentApi.delete("demo2", "test");
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
@@ -134,4 +134,24 @@ public class DeploymentApiImplTest {
|
|
|
deploymentApi.deleteIfExist("demo", "test");
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void testGet(){
|
|
|
+ Deployment deployment = deploymentApi.get("demo2", "test");
|
|
|
+ System.out.println(deployment);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testGetStatus() {
|
|
|
+ for (int i = 0 ; i<100 ; i++) {
|
|
|
+ DeploymentStatus status = deploymentApi.getStatus("demo2", "test");
|
|
|
+ System.out.println(status);
|
|
|
+ try {
|
|
|
+ Thread.sleep(10000);
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|