test: support for 1.24 toolchain

This commit is contained in:
Marc Nuri
2025-03-31 09:45:41 +02:00
parent fafdf9af5d
commit bea026a13e
3 changed files with 3 additions and 5 deletions

View File

@@ -4,8 +4,7 @@ import (
"os"
)
//goland:noinspection GoTestName
func ExampleVersion() {
func Example_version() {
oldArgs := os.Args
defer func() { os.Args = oldArgs }()
os.Args = []string{"kubernetes-mcp-server", "--version"}

2
go.mod
View File

@@ -1,6 +1,6 @@
module github.com/manusa/kubernetes-mcp-server
go 1.23.5
go 1.24.1
require (
github.com/fsnotify/fsnotify v1.8.0

View File

@@ -51,7 +51,7 @@ func TestProjectsListInOpenShift(t *testing.T) {
defer c.inOpenShift()() // n.b. two sets of parentheses to invoke the first function
c.mcpServer.server.AddTools(c.mcpServer.initNamespaces()...)
dynamicClient := dynamic.NewForConfigOrDie(envTestRestConfig)
_, err := dynamicClient.Resource(schema.GroupVersionResource{Group: "project.openshift.io", Version: "v1", Resource: "projects"}).
_, _ = dynamicClient.Resource(schema.GroupVersionResource{Group: "project.openshift.io", Version: "v1", Resource: "projects"}).
Create(c.ctx, &unstructured.Unstructured{Object: map[string]interface{}{
"apiVersion": "project.openshift.io/v1",
"kind": "Project",
@@ -59,7 +59,6 @@ func TestProjectsListInOpenShift(t *testing.T) {
"name": "an-openshift-project",
},
}}, metav1.CreateOptions{})
println(err)
toolResult, err := c.callTool("projects_list", map[string]interface{}{})
t.Run("projects_list returns project list", func(t *testing.T) {
if err != nil {