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

Function process_kustomize_pair

internal/cbm/extract_k8s.c:519–546  ·  view source on GitHub ↗

Process a single block_mapping_pair for kustomize list keys.

Source from the content-addressed store, hash-verified

517
518// Process a single block_mapping_pair for kustomize list keys.
519static void process_kustomize_pair(CBMExtractCtx *ctx, TSNode pair) {
520 if (strcmp(ts_node_type(pair), "block_mapping_pair") != 0) {
521 return;
522 }
523 TSNode key_node = ts_node_named_child(pair, 0);
524 if (ts_node_is_null(key_node)) {
525 return;
526 }
527 const char *key_text = get_scalar_text(ctx->arena, key_node, ctx->source);
528 if (!key_text) {
529 return;
530 }
531 TSNode val_node = unwrap_pair_value(pair);
532 if (ts_node_is_null(val_node) || strcmp(ts_node_type(val_node), "block_sequence") != 0) {
533 return;
534 }
535 if (strcmp(key_text, "helmCharts") == 0) {
536 emit_kustomize_charts(ctx, val_node);
537 return;
538 }
539 if (!is_kustomize_list_key(key_text)) {
540 return;
541 }
542 emit_kustomize_sequence(ctx, val_node, key_text);
543 if (strcmp(key_text, "patches") == 0) {
544 emit_kustomize_patches(ctx, val_node);
545 }
546}
547
548// Emit a "Class" def named after the document's `kind` scalar. A kustomization
549// file has no metadata.name, so the def name is the bare kind ("Kustomization").

Callers 1

extract_kustomizeFunction · 0.85

Calls 6

get_scalar_textFunction · 0.85
unwrap_pair_valueFunction · 0.85
emit_kustomize_chartsFunction · 0.85
is_kustomize_list_keyFunction · 0.85
emit_kustomize_sequenceFunction · 0.85
emit_kustomize_patchesFunction · 0.85

Tested by

no test coverage detected