Skip to content

fix(storage): [backport v3.2] ensure model-cache init namespace has unbound DNS label in NVMesh path - #1304

Merged
apartha-nv merged 7 commits into
release-src/compute-plane-services/nvca/v3.2from
backport/1303-modelcache-nvmesh-unbound-dns-v3.2
Aug 31, 2026
Merged

fix(storage): [backport v3.2] ensure model-cache init namespace has unbound DNS label in NVMesh path#1304
apartha-nv merged 7 commits into
release-src/compute-plane-services/nvca/v3.2from
backport/1303-modelcache-nvmesh-unbound-dns-v3.2

Conversation

@apartha-nv

Copy link
Copy Markdown
Contributor

Customer Summary

Backport of #1303 to v3.2.

Fixes model-cache initialization for helm-chart functions on NVMesh clusters (e.g. forge/DGXC). Confirmed still reproducing on 3.2.15 — the samba-path fix from #1218 did not cover NVMesh clusters.

TL;DR

Cherry-pick of #1303 onto release-src/compute-plane-services/nvca/v3.2. Adds ensureCreated + ensureNamespaceLabels at doInitModelCacheNVMesh entry so the namespace gets WorkloadInstanceTypeLabel on NVMesh clusters.

Tickets

Backport of #1303. Follow-up to #1218. Relates to NO-REF.

@apartha-nv
apartha-nv requested a review from a team as a code owner August 28, 2026 08:58
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 75813924-ee67-4fa6-8533-53ba30b24e90

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@apartha-nv
apartha-nv force-pushed the backport/1303-modelcache-nvmesh-unbound-dns-v3.2 branch from 0798ab0 to e1116ad Compare August 28, 2026 09:34
…space at startup

The namespace is created once at NVCA startup in backendk8scache.go with
AlreadyExists-is-success and no patch, so pre-existing namespaces on
upgraded clusters never received WorkloadInstanceTypeLabel regardless of
backend -- the samba-path fix (#1116) only applied during a model-attached
deploy and only for the samba backend.

Add ensureModelCacheNamespaceLabel immediately after the Create call in
backendk8scache.go. It runs on every NVCA restart via JSON patch 'add'
(idempotent: inserts when absent, updates when present), so upgraded
clusters receive the label immediately without needing a model-attached
helm deploy to trigger reconciliation.

The samba path's ensureNamespaceLabels remains as belt-and-suspenders
for the case where samba creates the namespace itself.

Relates to NO-REF
…l; add envtest

JSON patch 'add' requires the parent path /metadata/labels to exist; a
namespace with nil labels would cause startup to fail with a patch error.
Switch to strategic merge patch which creates the labels map when absent
and merges into it when present.

Add envtest covering:
- nil labels (the case JSON patch 'add' would have rejected)
- pre-existing labels (merge preserves unrelated keys)
- label already correct (idempotent, no error)

Update mock tests to match the new patch type and payload.
…test deps

Required by TestEnsureModelCacheNamespaceLabel_Envtest which uses
nvcaenvtest.SetupEnvtest and kubernetes.NewForConfig.
Tests using nvcaenvtest.SetupEnvtest must include the CRD manifests
as data so Bazel materializes them in the runfiles tree at the path
runtime.Caller(0) resolves to in envtest.go.
…NVCA CRDs needed

nvcaenvtest.SetupEnvtest loads NVCA CRDs from a path resolved via
runtime.Caller(0), which breaks in Bazel sandboxes because the source
tree is not present at that path. The namespace label test only needs
core Kubernetes resources (Namespace), so switch to a plain
envtest.Environment without CRD loading. Also revert the now-unused
internal/envtest dep and CRD data entry from BUILD.bazel.
@apartha-nv
apartha-nv force-pushed the backport/1303-modelcache-nvmesh-unbound-dns-v3.2 branch from 3623c4d to 35f7ac8 Compare August 31, 2026 19:43
@apartha-nv
apartha-nv merged commit a967088 into release-src/compute-plane-services/nvca/v3.2 Aug 31, 2026
12 checks passed
@apartha-nv
apartha-nv deleted the backport/1303-modelcache-nvmesh-unbound-dns-v3.2 branch August 31, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants