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

Function k8s_mapping_ref

internal/cbm/extract_k8s.c:1388–1399  ·  view source on GitHub ↗

The reference a mapping holds in its kind/name/namespace: to `kind`, or (NULL) to its own `kind` field, one of `allowed` (NULL: any), `dflt` when absent.

Source from the content-addressed store, hash-verified

1386// (NULL) to its own `kind` field, one of `allowed` (NULL: any), `dflt`
1387// when absent.
1388static void k8s_mapping_ref(k8s_walk_t *w, TSNode mapping, const char *kind, const char *allowed,
1389 const char *dflt, const char *via, const char *edge) {
1390 if (!kind) {
1391 kind = k8s_field(w, mapping, "kind");
1392 kind = kind ? kind : dflt;
1393 if (!kind || (allowed && !k8s_kind_in(allowed, kind))) {
1394 return;
1395 }
1396 }
1397 k8s_emit_ref(w, kind, k8s_field(w, mapping, "namespace"), k8s_field(w, mapping, "name"), via,
1398 edge);
1399}
1400
1401// Where an env[] item's value comes from: "value", or its valueFrom kind
1402// (configMapKeyRef, secretKeyRef, fieldRef, resourceFieldRef, fileKeyRef;

Callers 1

k8s_mappingFunction · 0.85

Calls 3

k8s_fieldFunction · 0.85
k8s_kind_inFunction · 0.85
k8s_emit_refFunction · 0.85

Tested by

no test coverage detected