Skip to content

Commit 2c9fd82

Browse files
committed
test: handle cluster parameter
Signed-off-by: Calum Murray <[email protected]>
1 parent 173eb4c commit 2c9fd82

File tree

7 files changed

+739
-5
lines changed

7 files changed

+739
-5
lines changed

pkg/mcp/testdata/toolsets-config-tools.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
"inputSchema": {
1212
"type": "object",
1313
"properties": {
14+
"cluster": {
15+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
16+
"enum": [
17+
"additional-cluster",
18+
"fake"
19+
],
20+
"type": "string"
21+
},
1422
"minified": {
1523
"description": "Return a minified version of the configuration. If set to true, keeps only the current-context and the relevant pieces of the configuration for that context. If set to false, all contexts, clusters, auth-infos, and users are returned in the configuration. (Optional, default true)",
1624
"type": "boolean"

pkg/mcp/testdata/toolsets-core-tools.json

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
"inputSchema": {
1212
"type": "object",
1313
"properties": {
14+
"cluster": {
15+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
16+
"enum": [
17+
"additional-cluster",
18+
"fake"
19+
],
20+
"type": "string"
21+
},
1422
"namespace": {
1523
"description": "Optional Namespace to retrieve the events from. If not provided, will list events from all namespaces",
1624
"type": "string"
@@ -29,7 +37,17 @@
2937
},
3038
"description": "List all the Kubernetes namespaces in the current cluster",
3139
"inputSchema": {
32-
"type": "object"
40+
"type": "object",
41+
"properties": {
42+
"cluster": {
43+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
44+
"enum": [
45+
"additional-cluster",
46+
"fake"
47+
],
48+
"type": "string"
49+
}
50+
}
3351
},
3452
"name": "namespaces_list"
3553
},
@@ -45,6 +63,14 @@
4563
"inputSchema": {
4664
"type": "object",
4765
"properties": {
66+
"cluster": {
67+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
68+
"enum": [
69+
"additional-cluster",
70+
"fake"
71+
],
72+
"type": "string"
73+
},
4874
"name": {
4975
"description": "Name of the Pod to delete",
5076
"type": "string"
@@ -72,6 +98,14 @@
7298
"inputSchema": {
7399
"type": "object",
74100
"properties": {
101+
"cluster": {
102+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
103+
"enum": [
104+
"additional-cluster",
105+
"fake"
106+
],
107+
"type": "string"
108+
},
75109
"command": {
76110
"description": "Command to execute in the Pod container. The first item is the command to be run, and the rest are the arguments to that command. Example: [\"ls\", \"-l\", \"/tmp\"]",
77111
"items": {
@@ -111,6 +145,14 @@
111145
"inputSchema": {
112146
"type": "object",
113147
"properties": {
148+
"cluster": {
149+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
150+
"enum": [
151+
"additional-cluster",
152+
"fake"
153+
],
154+
"type": "string"
155+
},
114156
"name": {
115157
"description": "Name of the Pod",
116158
"type": "string"
@@ -138,6 +180,14 @@
138180
"inputSchema": {
139181
"type": "object",
140182
"properties": {
183+
"cluster": {
184+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
185+
"enum": [
186+
"additional-cluster",
187+
"fake"
188+
],
189+
"type": "string"
190+
},
141191
"labelSelector": {
142192
"description": "Optional Kubernetes label selector (e.g. 'app=myapp,env=prod' or 'app in (myapp,yourapp)'), use this option when you want to filter the pods by label",
143193
"pattern": "([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]",
@@ -159,6 +209,14 @@
159209
"inputSchema": {
160210
"type": "object",
161211
"properties": {
212+
"cluster": {
213+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
214+
"enum": [
215+
"additional-cluster",
216+
"fake"
217+
],
218+
"type": "string"
219+
},
162220
"labelSelector": {
163221
"description": "Optional Kubernetes label selector (e.g. 'app=myapp,env=prod' or 'app in (myapp,yourapp)'), use this option when you want to filter the pods by label",
164222
"pattern": "([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]",
@@ -187,6 +245,14 @@
187245
"inputSchema": {
188246
"type": "object",
189247
"properties": {
248+
"cluster": {
249+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
250+
"enum": [
251+
"additional-cluster",
252+
"fake"
253+
],
254+
"type": "string"
255+
},
190256
"container": {
191257
"description": "Name of the Pod container to get the logs from (Optional)",
192258
"type": "string"
@@ -228,6 +294,14 @@
228294
"inputSchema": {
229295
"type": "object",
230296
"properties": {
297+
"cluster": {
298+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
299+
"enum": [
300+
"additional-cluster",
301+
"fake"
302+
],
303+
"type": "string"
304+
},
231305
"image": {
232306
"description": "Container Image to run in the Pod",
233307
"type": "string"
@@ -263,6 +337,14 @@
263337
"inputSchema": {
264338
"type": "object",
265339
"properties": {
340+
"cluster": {
341+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
342+
"enum": [
343+
"additional-cluster",
344+
"fake"
345+
],
346+
"type": "string"
347+
},
266348
"all_namespaces": {
267349
"default": true,
268350
"description": "If true, list the resource consumption for all Pods in all namespaces. If false, list the resource consumption for Pods in the provided namespace or the current namespace",
@@ -297,6 +379,14 @@
297379
"inputSchema": {
298380
"type": "object",
299381
"properties": {
382+
"cluster": {
383+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
384+
"enum": [
385+
"additional-cluster",
386+
"fake"
387+
],
388+
"type": "string"
389+
},
300390
"resource": {
301391
"description": "A JSON or YAML containing a representation of the Kubernetes resource. Should include top-level fields such as apiVersion,kind,metadata, and spec",
302392
"type": "string"
@@ -320,6 +410,14 @@
320410
"inputSchema": {
321411
"type": "object",
322412
"properties": {
413+
"cluster": {
414+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
415+
"enum": [
416+
"additional-cluster",
417+
"fake"
418+
],
419+
"type": "string"
420+
},
323421
"apiVersion": {
324422
"description": "apiVersion of the resource (examples of valid apiVersion are: v1, apps/v1, networking.k8s.io/v1)",
325423
"type": "string"
@@ -357,6 +455,14 @@
357455
"inputSchema": {
358456
"type": "object",
359457
"properties": {
458+
"cluster": {
459+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
460+
"enum": [
461+
"additional-cluster",
462+
"fake"
463+
],
464+
"type": "string"
465+
},
360466
"apiVersion": {
361467
"description": "apiVersion of the resource (examples of valid apiVersion are: v1, apps/v1, networking.k8s.io/v1)",
362468
"type": "string"
@@ -394,6 +500,14 @@
394500
"inputSchema": {
395501
"type": "object",
396502
"properties": {
503+
"cluster": {
504+
"description": "Optional parameter selecting which cluster to run the tool in. Defaults to fake if not set",
505+
"enum": [
506+
"additional-cluster",
507+
"fake"
508+
],
509+
"type": "string"
510+
},
397511
"apiVersion": {
398512
"description": "apiVersion of the resources (examples of valid apiVersion are: v1, apps/v1, networking.k8s.io/v1)",
399513
"type": "string"

0 commit comments

Comments
 (0)