File tree Expand file tree Collapse file tree
src/test/java/io/github/kubesys/client/testcases Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 */
2020public class LifecycleTest extends AbstractKubernetesClientTest {
2121
22+ static String CreateYaml = "apiVersion: v1\r \n "
23+ + "kind: Pod\r \n "
24+ + "metadata:\r \n "
25+ + " name: busybox\r \n "
26+ + " namespace: default\r \n "
27+ + " labels:\r \n "
28+ + " test: test\r \n "
29+ + "spec:\r \n "
30+ + " containers:\r \n "
31+ + " - image: busybox\r \n "
32+ + " env:\r \n "
33+ + " - name: abc\r \n "
34+ + " value: abc\r \n "
35+ + " command:\r \n "
36+ + " - sleep\r \n "
37+ + " - '3600'\r \n "
38+ + " imagePullPolicy: IfNotPresent\r \n "
39+ + " name: busybox\r \n "
40+ + " restartPolicy: Always" ;
41+
2242 static String CreateJSON = "{\r \n "
2343 + " \" apiVersion\" : \" v1\" ,\r \n "
2444 + " \" kind\" : \" Pod\" ,\r \n "
@@ -49,14 +69,15 @@ public class LifecycleTest extends AbstractKubernetesClientTest {
4969
5070
5171 public static void main (String [] args ) throws Exception {
72+ // System.out.println(CreateJSON);
5273 KubernetesClient client = createClient1 (null );
5374
54- // create(client);
75+ create (client );
5576// updateStatus(client);
5677// update(client);
5778// get(client);
58- list (client );
59- watch (client );
79+ // list(client);
80+ // watch(client);
6081// delete(client);
6182 }
6283
@@ -125,7 +146,8 @@ protected static void get(KubernetesClient client) throws Exception {
125146
126147
127148 protected static void create (KubernetesClient client ) throws Exception {
128- System .out .println (client .createResource (new ObjectMapper ().readTree (CreateJSON )));
149+ // System.out.println(client.createResource(new ObjectMapper().readTree(CreateJSON)));
150+ System .out .println (client .createResourceUsingYaml (CreateYaml ));
129151 }
130152
131153 protected static void create (KubernetesClient client , JsonNode json ) throws Exception {
You can’t perform that action at this time.
0 commit comments