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

Function cbm_pipeline_image_node

src/pipeline/pass_docker.c:373–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371}
372
373int64_t cbm_pipeline_image_node(cbm_pipeline_ctx_t *ctx, const char *ref) {
374 char repo[CBM_SZ_512];
375 char reg[CBM_SZ_512];
376 if (!ref || dk_ieq(ref, "scratch") ||
377 !dk_normalize(ref, repo, sizeof(repo), reg, sizeof(reg))) {
378 return 0;
379 }
380 char qn[CBM_SZ_1K];
381 snprintf(qn, sizeof(qn), "__image__%s", repo);
382 char esc_repo[CBM_SZ_1K];
383 char esc_reg[CBM_SZ_1K];
384 cbm_json_escape(esc_repo, (int)sizeof(esc_repo), repo);
385 cbm_json_escape(esc_reg, (int)sizeof(esc_reg), reg);
386 char node_props[CBM_SZ_2K];
387 snprintf(node_props, sizeof(node_props), "{\"repository\":\"%s\",\"registry\":\"%s\"}",
388 esc_repo, esc_reg);
389 return cbm_gbuf_upsert_node(ctx->gbuf, "Image", repo, qn, "", 0, 0, node_props);
390}
391
392/* An environment variable name: [A-Za-z_][A-Za-z0-9_.-]*. */
393static bool dk_env_key(const char *k) {

Callers 6

k8s_link_imagesFunction · 0.85
sh_link_buildFunction · 0.85
dk_linkFunction · 0.85
dk_build_siteFunction · 0.85
dk_compose_serviceFunction · 0.85
dk_hub_repoFunction · 0.85

Calls 4

dk_ieqFunction · 0.85
dk_normalizeFunction · 0.85
cbm_json_escapeFunction · 0.85
cbm_gbuf_upsert_nodeFunction · 0.85

Tested by

no test coverage detected