Skip to content

[BUG] InferenceService: spec.modelCache.claimName silently ignored when caching is off #965

Description

@Defilan

Bug Description

spec.modelCache.claimName (added in #960) lets an InferenceService point at a user-owned cache PVC. But when model caching is effectively OFF, a set claimName is silently ignored: the storage builder routes to buildEmptyDirStorageConfig, which never consults claimName, so the pod gets an emptyDir and re-downloads the model on every restart with no event, condition, or log.

Caching is off when useCache := effectiveModelCacheKey(model) != "" && r.ModelCachePath != "" is false, e.g.:

  • the chart sets modelCache.enabled: false,
  • the model uses a file:// / local source, or
  • a remote single-file model is reconciled before Status.CacheKey is populated.

#960 deliberately added a ModelCacheClaimIgnored warning for the pvc://-source case (inferenceservice_controller.go) to avoid exactly this silent drop, but the symmetric caching-off case was missed.

Steps to Reproduce

  1. Install the chart with modelCache.enabled: false (or use a file:// model source).
  2. Create an InferenceService with spec.modelCache.claimName: my-cache.
  3. Observe the pod mounts an emptyDir, not the named PVC, and re-downloads on restart. No warning event is emitted.

Expected Behavior

When claimName is set but caching is off, emit the same ModelCacheClaimIgnored warning event (or fail closed), so the ignored config is visible. This matches the PR's own "no silent fallback" contract.

Actual Behavior

claimName is silently dropped; the pod gets an emptyDir and re-downloads every restart, with no event/condition/log.

Environment

LLMKube Version: main (post-#960)

Notes

Small, localized fix: add a claimName != "" && !useCache check next to the existing pvc:// warning in Reconcile (~15-20 lines + a unit test asserting the event). Follow-up from the #960 review; not a GC/data-loss risk (the user PVC is never adopted), purely an observability gap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions