mirror of
https://github.com/containers/kubernetes-mcp-server.git
synced 2025-10-23 01:22:57 +03:00
Users can now enable or disable different toolsets either by providing a command-line flag or by setting the toolsets array field in the TOML configuration. Downstream Kubernetes API developers can declare toolsets for their APIs by creating a new nested package in pkg/toolsets and registering it in pkg/mcp/modules.go Signed-off-by: Marc Nuri <marc@marcnuri.com>
21 lines
444 B
Go
21 lines
444 B
Go
package kubernetes
|
|
|
|
import (
|
|
"context"
|
|
|
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
|
)
|
|
|
|
type Openshift interface {
|
|
IsOpenShift(context.Context) bool
|
|
}
|
|
|
|
func (m *Manager) IsOpenShift(_ context.Context) bool {
|
|
// This method should be fast and not block (it's called at startup)
|
|
_, err := m.discoveryClient.ServerResourcesForGroupVersion(schema.GroupVersion{
|
|
Group: "project.openshift.io",
|
|
Version: "v1",
|
|
}.String())
|
|
return err == nil
|
|
}
|