MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / k8s_api_group

Function k8s_api_group

internal/cbm/extract_k8s.c:1665–1676  ·  view source on GitHub ↗

The API group of an apiVersion: the part before '/', "core" for the core group ("v1"), "?" when the document names none. The version is not part of an object's identity.

Source from the content-addressed store, hash-verified

1663// group ("v1"), "?" when the document names none. The version is not part of
1664// an object's identity.
1665static void k8s_api_group(const char *api_version, char *out, size_t out_sz) {
1666 if (api_version[0] == '<') { // templated (a skeleton's symbolic `<...>`)
1667 snprintf(out, out_sz, "?");
1668 return;
1669 }
1670 const char *slash = strchr(api_version, '/');
1671 if (slash) {
1672 snprintf(out, out_sz, "%.*s", (int)(slash - api_version), api_version);
1673 } else {
1674 snprintf(out, out_sz, "%s", api_version[0] ? "core" : "?");
1675 }
1676}
1677
1678// One Resource def per document: `Kind/name`, QN
1679// `<file-base>::<group>/<Kind>/<declared namespace or ->/<name>` (IDENTITY.md).

Callers 1

extract_k8s_manifestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected