MCPcopy Create free account
hub / github.com/VersusControl/devops-ai-guidelines / Get

Method Get

02-mcp-for-devops/code/07/pkg/crd/dynamic.go:62–72  ·  view source on GitHub ↗

Get fetches a single resource by name.

(ctx context.Context, group, kind, namespace, name string)

Source from the content-addressed store, hash-verified

60
61// Get fetches a single resource by name.
62func (c *Client) Get(ctx context.Context, group, kind, namespace, name string) (*unstructured.Unstructured, error) {
63 gvr, namespaced, err := c.resolve(group, kind)
64 if err != nil {
65 return nil, err
66 }
67 var ri dynamic.ResourceInterface = c.dyn.Resource(gvr)
68 if namespaced {
69 ri = c.dyn.Resource(gvr).Namespace(namespace)
70 }
71 return ri.Get(ctx, name, metav1.GetOptions{})
72}
73
74// Resolve returns the GroupVersionResource for a Kind + Group pair. Useful
75// for MCP tool argument validation.

Callers

nothing calls this directly

Calls 1

resolveMethod · 0.95

Tested by

no test coverage detected