...
1
2
3
4
5
6 package testyaml
7
8 var UnformattedYaml1 = []byte(`
9 spec: a
10 status:
11 conditions:
12 - 3
13 - 1
14 - 2
15 apiVersion: example.com/v1beta1
16 kind: MyType
17 `)
18
19 var UnformattedYaml2 = []byte(`
20 spec2: a
21 status2:
22 conditions:
23 - 3
24 - 1
25 - 2
26 apiVersion: example.com/v1beta1
27 kind: MyType2
28 `)
29
30 var UnformattedYaml3 = []byte(`
31 apiVersion: v1
32 items:
33 - apiVersion: v1
34 kind: Namespace
35 metadata:
36 name: server-dev
37 resourceVersion: "7881"
38 selfLink: /api/v1/namespaces/server-dev
39 status:
40 phase: Active
41 - apiVersion: v1
42 kind: Namespace
43 metadata:
44 name: kube-node-lease
45 resourceVersion: "40"
46 selfLink: /api/v1/namespaces/kube-node-lease
47 status:
48 phase: Active
49 - apiVersion: v1
50 kind: Namespace
51 metadata:
52 name: kube-public
53 resourceVersion: "26"
54 selfLink: /api/v1/namespaces/kube-public
55 status:
56 phase: Active
57 - apiVersion: v1
58 kind: Namespace
59 metadata:
60 name: kube-system
61 resourceVersion: "143"
62 selfLink: /api/v1/namespaces/kube-system
63 status:
64 phase: Active
65 kind: List
66 metadata:
67 resourceVersion: ""
68 selfLink: ""
69 `)
70
71 var UnformattedJSON1 = []byte(`
72 {
73 "spec": "a",
74 "status": {"conditions": [3, 1, 2]},
75 "apiVersion": "example.com/v1beta1",
76 "kind": "MyType"
77 }
78 `)
79
80 var FormattedYaml1 = []byte(`apiVersion: example.com/v1beta1
81 kind: MyType
82 spec: a
83 status:
84 conditions:
85 - 3
86 - 1
87 - 2
88 `)
89
90 var FormattedYaml2 = []byte(`apiVersion: example.com/v1beta1
91 kind: MyType2
92 spec2: a
93 status2:
94 conditions:
95 - 3
96 - 1
97 - 2
98 `)
99
100 var FormattedFlowYAML1 = []byte(
101 `{"apiVersion": "example.com/v1beta1", "kind": "MyType", "spec": "a", "status": {"conditions": [3, 1, 2]}}
102 `)
103
104 var FormattedYaml3 = []byte(`apiVersion: v1
105 kind: List
106 metadata:
107 resourceVersion: ""
108 selfLink: ""
109 items:
110 - apiVersion: v1
111 kind: Namespace
112 metadata:
113 name: server-dev
114 resourceVersion: "7881"
115 selfLink: /api/v1/namespaces/server-dev
116 status:
117 phase: Active
118 - apiVersion: v1
119 kind: Namespace
120 metadata:
121 name: kube-node-lease
122 resourceVersion: "40"
123 selfLink: /api/v1/namespaces/kube-node-lease
124 status:
125 phase: Active
126 - apiVersion: v1
127 kind: Namespace
128 metadata:
129 name: kube-public
130 resourceVersion: "26"
131 selfLink: /api/v1/namespaces/kube-public
132 status:
133 phase: Active
134 - apiVersion: v1
135 kind: Namespace
136 metadata:
137 name: kube-system
138 resourceVersion: "143"
139 selfLink: /api/v1/namespaces/kube-system
140 status:
141 phase: Active
142 `)
143
View as plain text