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.
| 1663 | // group ("v1"), "?" when the document names none. The version is not part of |
| 1664 | // an object's identity. |
| 1665 | static 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). |
no outgoing calls
no test coverage detected