Adding CustomResourceDefinition Job and StatefulSet.
[ric-plt/ric-dep.git] / depRicKubernetesOperator / internal / controller / getCustomResourceDefinition.go
1 package controller\r
2 \r
3 import (\r
4         "context"\r
5         "fmt"\r
6 )\r
7 \r
8 func GetCustomResourceDefinition() []*unstructured.Unstructured {\r
9 \r
10         customResourceDefinition1 := &unstructured.Unstructured{\r
11                 Object: map[string]interface{}{\r
12                         "apiVersion": "apiextensions.k8s.io/v1beta1",\r
13                         "kind":       "CustomResourceDefinition",\r
14                         "metadata": map[string]interface{}{\r
15                                 "labels": map[string]interface{}{\r
16                                         "app.kubernetes.io/instance":   "release-name",\r
17                                         "app.kubernetes.io/managed-by": "Helm",\r
18                                         "app.kubernetes.io/name":       "kong",\r
19                                         "app.kubernetes.io/version":    "1.4",\r
20                                         "helm.sh/chart":                "kong-0.36.6",\r
21                                 },\r
22                                 "name": "kongconsumers.configuration.konghq.com",\r
23                         },\r
24                         "spec": map[string]interface{}{\r
25                                 "group": "configuration.konghq.com",\r
26                                 "names": map[string]interface{}{\r
27                                         "kind":   "KongConsumer",\r
28                                         "plural": "kongconsumers",\r
29                                         "shortNames": []interface{}{\r
30                                                 "kc",\r
31                                         },\r
32                                 },\r
33                                 "scope": "Namespaced",\r
34                                 "validation": map[string]interface{}{\r
35                                         "openAPIV3Schema": map[string]interface{}{\r
36                                                 "properties": map[string]interface{}{\r
37                                                         "credentials": map[string]interface{}{\r
38                                                                 "items": map[string]interface{}{\r
39                                                                         "type": "string",\r
40                                                                 },\r
41                                                                 "type": "array",\r
42                                                         },\r
43                                                         "custom_id": map[string]interface{}{\r
44                                                                 "type": "string",\r
45                                                         },\r
46                                                         "username": map[string]interface{}{\r
47                                                                 "type": "string",\r
48                                                         },\r
49                                                 },\r
50                                         },\r
51                                 },\r
52                                 "version": "v1",\r
53                                 "additionalPrinterColumns": []interface{}{\r
54                                         map[string]interface{}{\r
55                                                 "JSONPath":    ".username",\r
56                                                 "description": "Username of a Kong Consumer",\r
57                                                 "name":        "Username",\r
58                                                 "type":        "string",\r
59                                         },\r
60                                         map[string]interface{}{\r
61                                                 "type":        "date",\r
62                                                 "JSONPath":    ".metadata.creationTimestamp",\r
63                                                 "description": "Age",\r
64                                                 "name":        "Age",\r
65                                         },\r
66                                 },\r
67                         },\r
68                 },\r
69         }\r
70 \r
71         customResourceDefinition2 := &unstructured.Unstructured{\r
72                 Object: map[string]interface{}{\r
73                         "apiVersion": "apiextensions.k8s.io/v1beta1",\r
74                         "kind":       "CustomResourceDefinition",\r
75                         "metadata": map[string]interface{}{\r
76                                 "labels": map[string]interface{}{\r
77                                         "app.kubernetes.io/instance":   "release-name",\r
78                                         "app.kubernetes.io/managed-by": "Helm",\r
79                                         "app.kubernetes.io/name":       "kong",\r
80                                         "app.kubernetes.io/version":    "1.4",\r
81                                         "helm.sh/chart":                "kong-0.36.6",\r
82                                 },\r
83                                 "name": "kongcredentials.configuration.konghq.com",\r
84                         },\r
85                         "spec": map[string]interface{}{\r
86                                 "version": "v1",\r
87                                 "additionalPrinterColumns": []interface{}{\r
88                                         map[string]interface{}{\r
89                                                 "JSONPath":    ".type",\r
90                                                 "description": "Type of credential",\r
91                                                 "name":        "Credential-type",\r
92                                                 "type":        "string",\r
93                                         },\r
94                                         map[string]interface{}{\r
95                                                 "JSONPath":    ".metadata.creationTimestamp",\r
96                                                 "description": "Age",\r
97                                                 "name":        "Age",\r
98                                                 "type":        "date",\r
99                                         },\r
100                                         map[string]interface{}{\r
101                                                 "type":        "string",\r
102                                                 "JSONPath":    ".consumerRef",\r
103                                                 "description": "Owner of the credential",\r
104                                                 "name":        "Consumer-Ref",\r
105                                         },\r
106                                 },\r
107                                 "group": "configuration.konghq.com",\r
108                                 "names": map[string]interface{}{\r
109                                         "kind":   "KongCredential",\r
110                                         "plural": "kongcredentials",\r
111                                 },\r
112                                 "scope": "Namespaced",\r
113                                 "validation": map[string]interface{}{\r
114                                         "openAPIV3Schema": map[string]interface{}{\r
115                                                 "properties": map[string]interface{}{\r
116                                                         "consumerRef": map[string]interface{}{\r
117                                                                 "type": "string",\r
118                                                         },\r
119                                                         "type": map[string]interface{}{\r
120                                                                 "type": "string",\r
121                                                         },\r
122                                                 },\r
123                                                 "required": []interface{}{\r
124                                                         "consumerRef",\r
125                                                         "type",\r
126                                                 },\r
127                                         },\r
128                                 },\r
129                         },\r
130                 },\r
131         }\r
132 \r
133         customResourceDefinition3 := &unstructured.Unstructured{\r
134                 Object: map[string]interface{}{\r
135                         "spec": map[string]interface{}{\r
136                                 "names": map[string]interface{}{\r
137                                         "kind":   "KongPlugin",\r
138                                         "plural": "kongplugins",\r
139                                         "shortNames": []interface{}{\r
140                                                 "kp",\r
141                                         },\r
142                                 },\r
143                                 "scope": "Namespaced",\r
144                                 "validation": map[string]interface{}{\r
145                                         "openAPIV3Schema": map[string]interface{}{\r
146                                                 "properties": map[string]interface{}{\r
147                                                         "protocols": map[string]interface{}{\r
148                                                                 "items": map[string]interface{}{\r
149                                                                         "type": "string",\r
150                                                                         "enum": []interface{}{\r
151                                                                                 "http",\r
152                                                                                 "https",\r
153                                                                                 "tcp",\r
154                                                                                 "tls",\r
155                                                                                 "grpc",\r
156                                                                                 "grpcs",\r
157                                                                         },\r
158                                                                 },\r
159                                                                 "type": "array",\r
160                                                         },\r
161                                                         "run_on": map[string]interface{}{\r
162                                                                 "enum": []interface{}{\r
163                                                                         "first",\r
164                                                                         "second",\r
165                                                                         "all",\r
166                                                                 },\r
167                                                                 "type": "string",\r
168                                                         },\r
169                                                         "config": map[string]interface{}{\r
170                                                                 "type": "object",\r
171                                                         },\r
172                                                         "disabled": map[string]interface{}{\r
173                                                                 "type": "boolean",\r
174                                                         },\r
175                                                         "plugin": map[string]interface{}{\r
176                                                                 "type": "string",\r
177                                                         },\r
178                                                 },\r
179                                                 "required": []interface{}{\r
180                                                         "plugin",\r
181                                                 },\r
182                                         },\r
183                                 },\r
184                                 "version": "v1",\r
185                                 "additionalPrinterColumns": []interface{}{\r
186                                         map[string]interface{}{\r
187                                                 "JSONPath":    ".plugin",\r
188                                                 "description": "Name of the plugin",\r
189                                                 "name":        "Plugin-Type",\r
190                                                 "type":        "string",\r
191                                         },\r
192                                         map[string]interface{}{\r
193                                                 "description": "Age",\r
194                                                 "name":        "Age",\r
195                                                 "type":        "date",\r
196                                                 "JSONPath":    ".metadata.creationTimestamp",\r
197                                         },\r
198                                         map[string]interface{}{\r
199                                                 "JSONPath":    ".disabled",\r
200                                                 "description": "Indicates if the plugin is disabled",\r
201                                                 "name":        "Disabled",\r
202                                                 "priority":    1,\r
203                                                 "type":        "boolean",\r
204                                         },\r
205                                         map[string]interface{}{\r
206                                                 "JSONPath":    ".config",\r
207                                                 "description": "Configuration of the plugin",\r
208                                                 "name":        "Config",\r
209                                                 "priority":    1,\r
210                                                 "type":        "string",\r
211                                         },\r
212                                 },\r
213                                 "group": "configuration.konghq.com",\r
214                         },\r
215                         "apiVersion": "apiextensions.k8s.io/v1beta1",\r
216                         "kind":       "CustomResourceDefinition",\r
217                         "metadata": map[string]interface{}{\r
218                                 "labels": map[string]interface{}{\r
219                                         "app.kubernetes.io/instance":   "release-name",\r
220                                         "app.kubernetes.io/managed-by": "Helm",\r
221                                         "app.kubernetes.io/name":       "kong",\r
222                                         "app.kubernetes.io/version":    "1.4",\r
223                                         "helm.sh/chart":                "kong-0.36.6",\r
224                                 },\r
225                                 "name": "kongplugins.configuration.konghq.com",\r
226                         },\r
227                 },\r
228         }\r
229 \r
230         customResourceDefinition4 := &unstructured.Unstructured{\r
231                 Object: map[string]interface{}{\r
232                         "spec": map[string]interface{}{\r
233                                 "version": "v1",\r
234                                 "group":   "configuration.konghq.com",\r
235                                 "names": map[string]interface{}{\r
236                                         "plural": "kongingresses",\r
237                                         "shortNames": []interface{}{\r
238                                                 "ki",\r
239                                         },\r
240                                         "kind": "KongIngress",\r
241                                 },\r
242                                 "scope": "Namespaced",\r
243                                 "validation": map[string]interface{}{\r
244                                         "openAPIV3Schema": map[string]interface{}{\r
245                                                 "properties": map[string]interface{}{\r
246                                                         "upstream": map[string]interface{}{\r
247                                                                 "properties": map[string]interface{}{\r
248                                                                         "hash_fallback_header": map[string]interface{}{\r
249                                                                                 "type": "string",\r
250                                                                         },\r
251                                                                         "hash_on": map[string]interface{}{\r
252                                                                                 "type": "string",\r
253                                                                         },\r
254                                                                         "hash_on_cookie": map[string]interface{}{\r
255                                                                                 "type": "string",\r
256                                                                         },\r
257                                                                         "hash_on_cookie_path": map[string]interface{}{\r
258                                                                                 "type": "string",\r
259                                                                         },\r
260                                                                         "healthchecks": map[string]interface{}{\r
261                                                                                 "type": "object",\r
262                                                                                 "properties": map[string]interface{}{\r
263                                                                                         "passive": map[string]interface{}{\r
264                                                                                                 "properties": map[string]interface{}{\r
265                                                                                                         "healthy": map[string]interface{}{\r
266                                                                                                                 "properties": map[string]interface{}{\r
267                                                                                                                         "http_statuses": map[string]interface{}{\r
268                                                                                                                                 "items": map[string]interface{}{\r
269                                                                                                                                         "type": "integer",\r
270                                                                                                                                 },\r
271                                                                                                                                 "type": "array",\r
272                                                                                                                         },\r
273                                                                                                                         "interval": map[string]interface{}{\r
274                                                                                                                                 "minimum": 0,\r
275                                                                                                                                 "type":    "integer",\r
276                                                                                                                         },\r
277                                                                                                                         "successes": map[string]interface{}{\r
278                                                                                                                                 "type":    "integer",\r
279                                                                                                                                 "minimum": 0,\r
280                                                                                                                         },\r
281                                                                                                                 },\r
282                                                                                                                 "type": "object",\r
283                                                                                                         },\r
284                                                                                                         "unhealthy": map[string]interface{}{\r
285                                                                                                                 "type": "object",\r
286                                                                                                                 "properties": map[string]interface{}{\r
287                                                                                                                         "timeout": map[string]interface{}{\r
288                                                                                                                                 "minimum": 0,\r
289                                                                                                                                 "type":    "integer",\r
290                                                                                                                         },\r
291                                                                                                                         "http_failures": map[string]interface{}{\r
292                                                                                                                                 "minimum": 0,\r
293                                                                                                                                 "type":    "integer",\r
294                                                                                                                         },\r
295                                                                                                                         "http_statuses": map[string]interface{}{\r
296                                                                                                                                 "items": map[string]interface{}{\r
297                                                                                                                                         "type": "integer",\r
298                                                                                                                                 },\r
299                                                                                                                                 "type": "array",\r
300                                                                                                                         },\r
301                                                                                                                         "interval": map[string]interface{}{\r
302                                                                                                                                 "minimum": 0,\r
303                                                                                                                                 "type":    "integer",\r
304                                                                                                                         },\r
305                                                                                                                         "tcp_failures": map[string]interface{}{\r
306                                                                                                                                 "minimum": 0,\r
307                                                                                                                                 "type":    "integer",\r
308                                                                                                                         },\r
309                                                                                                                 },\r
310                                                                                                         },\r
311                                                                                                 },\r
312                                                                                                 "type": "object",\r
313                                                                                         },\r
314                                                                                         "active": map[string]interface{}{\r
315                                                                                                 "properties": map[string]interface{}{\r
316                                                                                                         "concurrency": map[string]interface{}{\r
317                                                                                                                 "minimum": 1,\r
318                                                                                                                 "type":    "integer",\r
319                                                                                                         },\r
320                                                                                                         "healthy": map[string]interface{}{\r
321                                                                                                                 "properties": map[string]interface{}{\r
322                                                                                                                         "http_statuses": map[string]interface{}{\r
323                                                                                                                                 "items": map[string]interface{}{\r
324                                                                                                                                         "type": "integer",\r
325                                                                                                                                 },\r
326                                                                                                                                 "type": "array",\r
327                                                                                                                         },\r
328                                                                                                                         "interval": map[string]interface{}{\r
329                                                                                                                                 "minimum": 0,\r
330                                                                                                                                 "type":    "integer",\r
331                                                                                                                         },\r
332                                                                                                                         "successes": map[string]interface{}{\r
333                                                                                                                                 "minimum": 0,\r
334                                                                                                                                 "type":    "integer",\r
335                                                                                                                         },\r
336                                                                                                                 },\r
337                                                                                                                 "type": "object",\r
338                                                                                                         },\r
339                                                                                                         "http_path": map[string]interface{}{\r
340                                                                                                                 "pattern": "^/.*$",\r
341                                                                                                                 "type":    "string",\r
342                                                                                                         },\r
343                                                                                                         "timeout": map[string]interface{}{\r
344                                                                                                                 "minimum": 0,\r
345                                                                                                                 "type":    "integer",\r
346                                                                                                         },\r
347                                                                                                         "unhealthy": map[string]interface{}{\r
348                                                                                                                 "type": "object",\r
349                                                                                                                 "properties": map[string]interface{}{\r
350                                                                                                                         "timeout": map[string]interface{}{\r
351                                                                                                                                 "minimum": 0,\r
352                                                                                                                                 "type":    "integer",\r
353                                                                                                                         },\r
354                                                                                                                         "http_failures": map[string]interface{}{\r
355                                                                                                                                 "minimum": 0,\r
356                                                                                                                                 "type":    "integer",\r
357                                                                                                                         },\r
358                                                                                                                         "http_statuses": map[string]interface{}{\r
359                                                                                                                                 "items": map[string]interface{}{\r
360                                                                                                                                         "type": "integer",\r
361                                                                                                                                 },\r
362                                                                                                                                 "type": "array",\r
363                                                                                                                         },\r
364                                                                                                                         "interval": map[string]interface{}{\r
365                                                                                                                                 "minimum": 0,\r
366                                                                                                                                 "type":    "integer",\r
367                                                                                                                         },\r
368                                                                                                                         "tcp_failures": map[string]interface{}{\r
369                                                                                                                                 "minimum": 0,\r
370                                                                                                                                 "type":    "integer",\r
371                                                                                                                         },\r
372                                                                                                                 },\r
373                                                                                                         },\r
374                                                                                                 },\r
375                                                                                                 "type": "object",\r
376                                                                                         },\r
377                                                                                 },\r
378                                                                         },\r
379                                                                         "slots": map[string]interface{}{\r
380                                                                                 "minimum": 10,\r
381                                                                                 "type":    "integer",\r
382                                                                         },\r
383                                                                         "algorithm": map[string]interface{}{\r
384                                                                                 "enum": []interface{}{\r
385                                                                                         "round-robin",\r
386                                                                                         "consistent-hashing",\r
387                                                                                         "least-connections",\r
388                                                                                 },\r
389                                                                                 "type": "string",\r
390                                                                         },\r
391                                                                         "hash_fallback": map[string]interface{}{\r
392                                                                                 "type": "string",\r
393                                                                         },\r
394                                                                         "hash_on_header": map[string]interface{}{\r
395                                                                                 "type": "string",\r
396                                                                         },\r
397                                                                         "host_header": map[string]interface{}{\r
398                                                                                 "type": "string",\r
399                                                                         },\r
400                                                                 },\r
401                                                                 "type": "object",\r
402                                                         },\r
403                                                         "proxy": map[string]interface{}{\r
404                                                                 "properties": map[string]interface{}{\r
405                                                                         "connect_timeout": map[string]interface{}{\r
406                                                                                 "minimum": 0,\r
407                                                                                 "type":    "integer",\r
408                                                                         },\r
409                                                                         "path": map[string]interface{}{\r
410                                                                                 "pattern": "^/.*$",\r
411                                                                                 "type":    "string",\r
412                                                                         },\r
413                                                                         "protocol": map[string]interface{}{\r
414                                                                                 "enum": []interface{}{\r
415                                                                                         "http",\r
416                                                                                         "https",\r
417                                                                                         "grpc",\r
418                                                                                         "grpcs",\r
419                                                                                 },\r
420                                                                                 "type": "string",\r
421                                                                         },\r
422                                                                         "read_timeout": map[string]interface{}{\r
423                                                                                 "minimum": 0,\r
424                                                                                 "type":    "integer",\r
425                                                                         },\r
426                                                                         "retries": map[string]interface{}{\r
427                                                                                 "minimum": 0,\r
428                                                                                 "type":    "integer",\r
429                                                                         },\r
430                                                                         "write_timeout": map[string]interface{}{\r
431                                                                                 "minimum": 0,\r
432                                                                                 "type":    "integer",\r
433                                                                         },\r
434                                                                 },\r
435                                                                 "type": "object",\r
436                                                         },\r
437                                                         "route": map[string]interface{}{\r
438                                                                 "properties": map[string]interface{}{\r
439                                                                         "protocols": map[string]interface{}{\r
440                                                                                 "items": map[string]interface{}{\r
441                                                                                         "type": "string",\r
442                                                                                         "enum": []interface{}{\r
443                                                                                                 "http",\r
444                                                                                                 "https",\r
445                                                                                                 "grpc",\r
446                                                                                                 "grpcs",\r
447                                                                                         },\r
448                                                                                 },\r
449                                                                                 "type": "array",\r
450                                                                         },\r
451                                                                         "regex_priority": map[string]interface{}{\r
452                                                                                 "type": "integer",\r
453                                                                         },\r
454                                                                         "strip_path": map[string]interface{}{\r
455                                                                                 "type": "boolean",\r
456                                                                         },\r
457                                                                         "headers": map[string]interface{}{\r
458                                                                                 "additionalProperties": map[string]interface{}{\r
459                                                                                         "items": map[string]interface{}{\r
460                                                                                                 "type": "string",\r
461                                                                                         },\r
462                                                                                         "type": "array",\r
463                                                                                 },\r
464                                                                                 "type": "object",\r
465                                                                         },\r
466                                                                         "https_redirect_status_code": map[string]interface{}{\r
467                                                                                 "type": "integer",\r
468                                                                         },\r
469                                                                         "methods": map[string]interface{}{\r
470                                                                                 "items": map[string]interface{}{\r
471                                                                                         "type": "string",\r
472                                                                                 },\r
473                                                                                 "type": "array",\r
474                                                                         },\r
475                                                                         "preserve_host": map[string]interface{}{\r
476                                                                                 "type": "boolean",\r
477                                                                         },\r
478                                                                 },\r
479                                                         },\r
480                                                 },\r
481                                         },\r
482                                 },\r
483                         },\r
484                         "apiVersion": "apiextensions.k8s.io/v1beta1",\r
485                         "kind":       "CustomResourceDefinition",\r
486                         "metadata": map[string]interface{}{\r
487                                 "labels": map[string]interface{}{\r
488                                         "helm.sh/chart":                "kong-0.36.6",\r
489                                         "app.kubernetes.io/instance":   "release-name",\r
490                                         "app.kubernetes.io/managed-by": "Helm",\r
491                                         "app.kubernetes.io/name":       "kong",\r
492                                         "app.kubernetes.io/version":    "1.4",\r
493                                 },\r
494                                 "name": "kongingresses.configuration.konghq.com",\r
495                         },\r
496                 },\r
497         }\r
498 \r
499         customResourceDefinition5 := &unstructured.Unstructured{\r
500                 Object: map[string]interface{}{\r
501                         "apiVersion": "apiextensions.k8s.io/v1beta1",\r
502                         "kind":       "CustomResourceDefinition",\r
503                         "metadata": map[string]interface{}{\r
504                                 "labels": map[string]interface{}{\r
505                                         "app.kubernetes.io/instance":   "release-name",\r
506                                         "app.kubernetes.io/managed-by": "Helm",\r
507                                         "app.kubernetes.io/name":       "kong",\r
508                                         "app.kubernetes.io/version":    "1.4",\r
509                                         "helm.sh/chart":                "kong-0.36.6",\r
510                                 },\r
511                                 "name": "kongconsumers.configuration.konghq.com",\r
512                         },\r
513                         "spec": map[string]interface{}{\r
514                                 "group": "configuration.konghq.com",\r
515                                 "names": map[string]interface{}{\r
516                                         "kind":   "KongConsumer",\r
517                                         "plural": "kongconsumers",\r
518                                         "shortNames": []interface{}{\r
519                                                 "kc",\r
520                                         },\r
521                                 },\r
522                                 "scope": "Namespaced",\r
523                                 "validation": map[string]interface{}{\r
524                                         "openAPIV3Schema": map[string]interface{}{\r
525                                                 "properties": map[string]interface{}{\r
526                                                         "credentials": map[string]interface{}{\r
527                                                                 "type": "array",\r
528                                                                 "items": map[string]interface{}{\r
529                                                                         "type": "string",\r
530                                                                 },\r
531                                                         },\r
532                                                         "custom_id": map[string]interface{}{\r
533                                                                 "type": "string",\r
534                                                         },\r
535                                                         "username": map[string]interface{}{\r
536                                                                 "type": "string",\r
537                                                         },\r
538                                                 },\r
539                                         },\r
540                                 },\r
541                                 "version": "v1",\r
542                                 "additionalPrinterColumns": []interface{}{\r
543                                         map[string]interface{}{\r
544                                                 "JSONPath":    ".username",\r
545                                                 "description": "Username of a Kong Consumer",\r
546                                                 "name":        "Username",\r
547                                                 "type":        "string",\r
548                                         },\r
549                                         map[string]interface{}{\r
550                                                 "JSONPath":    ".metadata.creationTimestamp",\r
551                                                 "description": "Age",\r
552                                                 "name":        "Age",\r
553                                                 "type":        "date",\r
554                                         },\r
555                                 },\r
556                         },\r
557                 },\r
558         }\r
559 \r
560         customResourceDefinition6 := &unstructured.Unstructured{\r
561                 Object: map[string]interface{}{\r
562                         "apiVersion": "apiextensions.k8s.io/v1beta1",\r
563                         "kind":       "CustomResourceDefinition",\r
564                         "metadata": map[string]interface{}{\r
565                                 "labels": map[string]interface{}{\r
566                                         "app.kubernetes.io/managed-by": "Helm",\r
567                                         "app.kubernetes.io/name":       "kong",\r
568                                         "app.kubernetes.io/version":    "1.4",\r
569                                         "helm.sh/chart":                "kong-0.36.6",\r
570                                         "app.kubernetes.io/instance":   "release-name",\r
571                                 },\r
572                                 "name": "kongcredentials.configuration.konghq.com",\r
573                         },\r
574                         "spec": map[string]interface{}{\r
575                                 "additionalPrinterColumns": []interface{}{\r
576                                         map[string]interface{}{\r
577                                                 "JSONPath":    ".type",\r
578                                                 "description": "Type of credential",\r
579                                                 "name":        "Credential-type",\r
580                                                 "type":        "string",\r
581                                         },\r
582                                         map[string]interface{}{\r
583                                                 "description": "Age",\r
584                                                 "name":        "Age",\r
585                                                 "type":        "date",\r
586                                                 "JSONPath":    ".metadata.creationTimestamp",\r
587                                         },\r
588                                         map[string]interface{}{\r
589                                                 "JSONPath":    ".consumerRef",\r
590                                                 "description": "Owner of the credential",\r
591                                                 "name":        "Consumer-Ref",\r
592                                                 "type":        "string",\r
593                                         },\r
594                                 },\r
595                                 "group": "configuration.konghq.com",\r
596                                 "names": map[string]interface{}{\r
597                                         "kind":   "KongCredential",\r
598                                         "plural": "kongcredentials",\r
599                                 },\r
600                                 "scope": "Namespaced",\r
601                                 "validation": map[string]interface{}{\r
602                                         "openAPIV3Schema": map[string]interface{}{\r
603                                                 "properties": map[string]interface{}{\r
604                                                         "consumerRef": map[string]interface{}{\r
605                                                                 "type": "string",\r
606                                                         },\r
607                                                         "type": map[string]interface{}{\r
608                                                                 "type": "string",\r
609                                                         },\r
610                                                 },\r
611                                                 "required": []interface{}{\r
612                                                         "consumerRef",\r
613                                                         "type",\r
614                                                 },\r
615                                         },\r
616                                 },\r
617                                 "version": "v1",\r
618                         },\r
619                 },\r
620         }\r
621 \r
622         customResourceDefinition7 := &unstructured.Unstructured{\r
623                 Object: map[string]interface{}{\r
624                         "apiVersion": "apiextensions.k8s.io/v1beta1",\r
625                         "kind":       "CustomResourceDefinition",\r
626                         "metadata": map[string]interface{}{\r
627                                 "labels": map[string]interface{}{\r
628                                         "app.kubernetes.io/instance":   "release-name",\r
629                                         "app.kubernetes.io/managed-by": "Helm",\r
630                                         "app.kubernetes.io/name":       "kong",\r
631                                         "app.kubernetes.io/version":    "1.4",\r
632                                         "helm.sh/chart":                "kong-0.36.6",\r
633                                 },\r
634                                 "name": "kongplugins.configuration.konghq.com",\r
635                         },\r
636                         "spec": map[string]interface{}{\r
637                                 "names": map[string]interface{}{\r
638                                         "kind":   "KongPlugin",\r
639                                         "plural": "kongplugins",\r
640                                         "shortNames": []interface{}{\r
641                                                 "kp",\r
642                                         },\r
643                                 },\r
644                                 "scope": "Namespaced",\r
645                                 "validation": map[string]interface{}{\r
646                                         "openAPIV3Schema": map[string]interface{}{\r
647                                                 "properties": map[string]interface{}{\r
648                                                         "config": map[string]interface{}{\r
649                                                                 "type": "object",\r
650                                                         },\r
651                                                         "disabled": map[string]interface{}{\r
652                                                                 "type": "boolean",\r
653                                                         },\r
654                                                         "plugin": map[string]interface{}{\r
655                                                                 "type": "string",\r
656                                                         },\r
657                                                         "protocols": map[string]interface{}{\r
658                                                                 "items": map[string]interface{}{\r
659                                                                         "enum": []interface{}{\r
660                                                                                 "http",\r
661                                                                                 "https",\r
662                                                                                 "tcp",\r
663                                                                                 "tls",\r
664                                                                                 "grpc",\r
665                                                                                 "grpcs",\r
666                                                                         },\r
667                                                                         "type": "string",\r
668                                                                 },\r
669                                                                 "type": "array",\r
670                                                         },\r
671                                                         "run_on": map[string]interface{}{\r
672                                                                 "type": "string",\r
673                                                                 "enum": []interface{}{\r
674                                                                         "first",\r
675                                                                         "second",\r
676                                                                         "all",\r
677                                                                 },\r
678                                                         },\r
679                                                 },\r
680                                                 "required": []interface{}{\r
681                                                         "plugin",\r
682                                                 },\r
683                                         },\r
684                                 },\r
685                                 "version": "v1",\r
686                                 "additionalPrinterColumns": []interface{}{\r
687                                         map[string]interface{}{\r
688                                                 "description": "Name of the plugin",\r
689                                                 "name":        "Plugin-Type",\r
690                                                 "type":        "string",\r
691                                                 "JSONPath":    ".plugin",\r
692                                         },\r
693                                         map[string]interface{}{\r
694                                                 "description": "Age",\r
695                                                 "name":        "Age",\r
696                                                 "type":        "date",\r
697                                                 "JSONPath":    ".metadata.creationTimestamp",\r
698                                         },\r
699                                         map[string]interface{}{\r
700                                                 "priority":    1,\r
701                                                 "type":        "boolean",\r
702                                                 "JSONPath":    ".disabled",\r
703                                                 "description": "Indicates if the plugin is disabled",\r
704                                                 "name":        "Disabled",\r
705                                         },\r
706                                         map[string]interface{}{\r
707                                                 "JSONPath":    ".config",\r
708                                                 "description": "Configuration of the plugin",\r
709                                                 "name":        "Config",\r
710                                                 "priority":    1,\r
711                                                 "type":        "string",\r
712                                         },\r
713                                 },\r
714                                 "group": "configuration.konghq.com",\r
715                         },\r
716                 },\r
717         }\r
718 \r
719         customResourceDefinition8 := &unstructured.Unstructured{\r
720                 Object: map[string]interface{}{\r
721                         "apiVersion": "apiextensions.k8s.io/v1beta1",\r
722                         "kind":       "CustomResourceDefinition",\r
723                         "metadata": map[string]interface{}{\r
724                                 "labels": map[string]interface{}{\r
725                                         "helm.sh/chart":                "kong-0.36.6",\r
726                                         "app.kubernetes.io/instance":   "release-name",\r
727                                         "app.kubernetes.io/managed-by": "Helm",\r
728                                         "app.kubernetes.io/name":       "kong",\r
729                                         "app.kubernetes.io/version":    "1.4",\r
730                                 },\r
731                                 "name": "kongingresses.configuration.konghq.com",\r
732                         },\r
733                         "spec": map[string]interface{}{\r
734                                 "group": "configuration.konghq.com",\r
735                                 "names": map[string]interface{}{\r
736                                         "plural": "kongingresses",\r
737                                         "shortNames": []interface{}{\r
738                                                 "ki",\r
739                                         },\r
740                                         "kind": "KongIngress",\r
741                                 },\r
742                                 "scope": "Namespaced",\r
743                                 "validation": map[string]interface{}{\r
744                                         "openAPIV3Schema": map[string]interface{}{\r
745                                                 "properties": map[string]interface{}{\r
746                                                         "proxy": map[string]interface{}{\r
747                                                                 "properties": map[string]interface{}{\r
748                                                                         "path": map[string]interface{}{\r
749                                                                                 "pattern": "^/.*$",\r
750                                                                                 "type":    "string",\r
751                                                                         },\r
752                                                                         "protocol": map[string]interface{}{\r
753                                                                                 "type": "string",\r
754                                                                                 "enum": []interface{}{\r
755                                                                                         "http",\r
756                                                                                         "https",\r
757                                                                                         "grpc",\r
758                                                                                         "grpcs",\r
759                                                                                 },\r
760                                                                         },\r
761                                                                         "read_timeout": map[string]interface{}{\r
762                                                                                 "minimum": 0,\r
763                                                                                 "type":    "integer",\r
764                                                                         },\r
765                                                                         "retries": map[string]interface{}{\r
766                                                                                 "minimum": 0,\r
767                                                                                 "type":    "integer",\r
768                                                                         },\r
769                                                                         "write_timeout": map[string]interface{}{\r
770                                                                                 "minimum": 0,\r
771                                                                                 "type":    "integer",\r
772                                                                         },\r
773                                                                         "connect_timeout": map[string]interface{}{\r
774                                                                                 "minimum": 0,\r
775                                                                                 "type":    "integer",\r
776                                                                         },\r
777                                                                 },\r
778                                                                 "type": "object",\r
779                                                         },\r
780                                                         "route": map[string]interface{}{\r
781                                                                 "properties": map[string]interface{}{\r
782                                                                         "https_redirect_status_code": map[string]interface{}{\r
783                                                                                 "type": "integer",\r
784                                                                         },\r
785                                                                         "methods": map[string]interface{}{\r
786                                                                                 "items": map[string]interface{}{\r
787                                                                                         "type": "string",\r
788                                                                                 },\r
789                                                                                 "type": "array",\r
790                                                                         },\r
791                                                                         "preserve_host": map[string]interface{}{\r
792                                                                                 "type": "boolean",\r
793                                                                         },\r
794                                                                         "protocols": map[string]interface{}{\r
795                                                                                 "items": map[string]interface{}{\r
796                                                                                         "type": "string",\r
797                                                                                         "enum": []interface{}{\r
798                                                                                                 "http",\r
799                                                                                                 "https",\r
800                                                                                                 "grpc",\r
801                                                                                                 "grpcs",\r
802                                                                                         },\r
803                                                                                 },\r
804                                                                                 "type": "array",\r
805                                                                         },\r
806                                                                         "regex_priority": map[string]interface{}{\r
807                                                                                 "type": "integer",\r
808                                                                         },\r
809                                                                         "strip_path": map[string]interface{}{\r
810                                                                                 "type": "boolean",\r
811                                                                         },\r
812                                                                         "headers": map[string]interface{}{\r
813                                                                                 "additionalProperties": map[string]interface{}{\r
814                                                                                         "items": map[string]interface{}{\r
815                                                                                                 "type": "string",\r
816                                                                                         },\r
817                                                                                         "type": "array",\r
818                                                                                 },\r
819                                                                                 "type": "object",\r
820                                                                         },\r
821                                                                 },\r
822                                                         },\r
823                                                         "upstream": map[string]interface{}{\r
824                                                                 "properties": map[string]interface{}{\r
825                                                                         "algorithm": map[string]interface{}{\r
826                                                                                 "enum": []interface{}{\r
827                                                                                         "round-robin",\r
828                                                                                         "consistent-hashing",\r
829                                                                                         "least-connections",\r
830                                                                                 },\r
831                                                                                 "type": "string",\r
832                                                                         },\r
833                                                                         "hash_fallback_header": map[string]interface{}{\r
834                                                                                 "type": "string",\r
835                                                                         },\r
836                                                                         "hash_on_cookie": map[string]interface{}{\r
837                                                                                 "type": "string",\r
838                                                                         },\r
839                                                                         "hash_on_cookie_path": map[string]interface{}{\r
840                                                                                 "type": "string",\r
841                                                                         },\r
842                                                                         "host_header": map[string]interface{}{\r
843                                                                                 "type": "string",\r
844                                                                         },\r
845                                                                         "hash_fallback": map[string]interface{}{\r
846                                                                                 "type": "string",\r
847                                                                         },\r
848                                                                         "hash_on": map[string]interface{}{\r
849                                                                                 "type": "string",\r
850                                                                         },\r
851                                                                         "hash_on_header": map[string]interface{}{\r
852                                                                                 "type": "string",\r
853                                                                         },\r
854                                                                         "healthchecks": map[string]interface{}{\r
855                                                                                 "type": "object",\r
856                                                                                 "properties": map[string]interface{}{\r
857                                                                                         "active": map[string]interface{}{\r
858                                                                                                 "properties": map[string]interface{}{\r
859                                                                                                         "timeout": map[string]interface{}{\r
860                                                                                                                 "minimum": 0,\r
861                                                                                                                 "type":    "integer",\r
862                                                                                                         },\r
863                                                                                                         "unhealthy": map[string]interface{}{\r
864                                                                                                                 "properties": map[string]interface{}{\r
865                                                                                                                         "http_failures": map[string]interface{}{\r
866                                                                                                                                 "type":    "integer",\r
867                                                                                                                                 "minimum": 0,\r
868                                                                                                                         },\r
869                                                                                                                         "http_statuses": map[string]interface{}{\r
870                                                                                                                                 "items": map[string]interface{}{\r
871                                                                                                                                         "type": "integer",\r
872                                                                                                                                 },\r
873                                                                                                                                 "type": "array",\r
874                                                                                                                         },\r
875                                                                                                                         "interval": map[string]interface{}{\r
876                                                                                                                                 "minimum": 0,\r
877                                                                                                                                 "type":    "integer",\r
878                                                                                                                         },\r
879                                                                                                                         "tcp_failures": map[string]interface{}{\r
880                                                                                                                                 "minimum": 0,\r
881                                                                                                                                 "type":    "integer",\r
882                                                                                                                         },\r
883                                                                                                                         "timeout": map[string]interface{}{\r
884                                                                                                                                 "minimum": 0,\r
885                                                                                                                                 "type":    "integer",\r
886                                                                                                                         },\r
887                                                                                                                 },\r
888                                                                                                                 "type": "object",\r
889                                                                                                         },\r
890                                                                                                         "concurrency": map[string]interface{}{\r
891                                                                                                                 "minimum": 1,\r
892                                                                                                                 "type":    "integer",\r
893                                                                                                         },\r
894                                                                                                         "healthy": map[string]interface{}{\r
895                                                                                                                 "properties": map[string]interface{}{\r
896                                                                                                                         "http_statuses": map[string]interface{}{\r
897                                                                                                                                 "items": map[string]interface{}{\r
898                                                                                                                                         "type": "integer",\r
899                                                                                                                                 },\r
900                                                                                                                                 "type": "array",\r
901                                                                                                                         },\r
902                                                                                                                         "interval": map[string]interface{}{\r
903                                                                                                                                 "minimum": 0,\r
904                                                                                                                                 "type":    "integer",\r
905                                                                                                                         },\r
906                                                                                                                         "successes": map[string]interface{}{\r
907                                                                                                                                 "minimum": 0,\r
908                                                                                                                                 "type":    "integer",\r
909                                                                                                                         },\r
910                                                                                                                 },\r
911                                                                                                                 "type": "object",\r
912                                                                                                         },\r
913                                                                                                         "http_path": map[string]interface{}{\r
914                                                                                                                 "pattern": "^/.*$",\r
915                                                                                                                 "type":    "string",\r
916                                                                                                         },\r
917                                                                                                 },\r
918                                                                                                 "type": "object",\r
919                                                                                         },\r
920                                                                                         "passive": map[string]interface{}{\r
921                                                                                                 "properties": map[string]interface{}{\r
922                                                                                                         "healthy": map[string]interface{}{\r
923                                                                                                                 "type": "object",\r
924                                                                                                                 "properties": map[string]interface{}{\r
925                                                                                                                         "http_statuses": map[string]interface{}{\r
926                                                                                                                                 "items": map[string]interface{}{\r
927                                                                                                                                         "type": "integer",\r
928                                                                                                                                 },\r
929                                                                                                                                 "type": "array",\r
930                                                                                                                         },\r
931                                                                                                                         "interval": map[string]interface{}{\r
932                                                                                                                                 "minimum": 0,\r
933                                                                                                                                 "type":    "integer",\r
934                                                                                                                         },\r
935                                                                                                                         "successes": map[string]interface{}{\r
936                                                                                                                                 "minimum": 0,\r
937                                                                                                                                 "type":    "integer",\r
938                                                                                                                         },\r
939                                                                                                                 },\r
940                                                                                                         },\r
941                                                                                                         "unhealthy": map[string]interface{}{\r
942                                                                                                                 "type": "object",\r
943                                                                                                                 "properties": map[string]interface{}{\r
944                                                                                                                         "http_statuses": map[string]interface{}{\r
945                                                                                                                                 "type": "array",\r
946                                                                                                                                 "items": map[string]interface{}{\r
947                                                                                                                                         "type": "integer",\r
948                                                                                                                                 },\r
949                                                                                                                         },\r
950                                                                                                                         "interval": map[string]interface{}{\r
951                                                                                                                                 "minimum": 0,\r
952                                                                                                                                 "type":    "integer",\r
953                                                                                                                         },\r
954                                                                                                                         "tcp_failures": map[string]interface{}{\r
955                                                                                                                                 "minimum": 0,\r
956                                                                                                                                 "type":    "integer",\r
957                                                                                                                         },\r
958                                                                                                                         "timeout": map[string]interface{}{\r
959                                                                                                                                 "minimum": 0,\r
960                                                                                                                                 "type":    "integer",\r
961                                                                                                                         },\r
962                                                                                                                         "http_failures": map[string]interface{}{\r
963                                                                                                                                 "minimum": 0,\r
964                                                                                                                                 "type":    "integer",\r
965                                                                                                                         },\r
966                                                                                                                 },\r
967                                                                                                         },\r
968                                                                                                 },\r
969                                                                                                 "type": "object",\r
970                                                                                         },\r
971                                                                                 },\r
972                                                                         },\r
973                                                                         "slots": map[string]interface{}{\r
974                                                                                 "minimum": 10,\r
975                                                                                 "type":    "integer",\r
976                                                                         },\r
977                                                                 },\r
978                                                                 "type": "object",\r
979                                                         },\r
980                                                 },\r
981                                         },\r
982                                 },\r
983                                 "version": "v1",\r
984                         },\r
985                 },\r
986         }\r
987 \r
988         return []*unstructured.Unstructured{customResourceDefinition1, customResourceDefinition2, customResourceDefinition3, customResourceDefinition4, customResourceDefinition5, customResourceDefinition6, customResourceDefinition7, customResourceDefinition8}\r
989 }