Skip to content

fix(chart): disable model cache when modelCache.enabled is false#801

Open
eleboucher wants to merge 1 commit into
defilantech:mainfrom
eleboucher:fix/model-cache-disable-flag
Open

fix(chart): disable model cache when modelCache.enabled is false#801
eleboucher wants to merge 1 commit into
defilantech:mainfrom
eleboucher:fix/model-cache-disable-flag

Conversation

@eleboucher

Copy link
Copy Markdown
Contributor

Problem

Setting modelCache.enabled: false does not actually disable the model cache. The operator's --model-cache-path flag defaults to /models (cmd/main.go), and caching is gated on that path being non-empty:

  • internal/controller/inferenceservice_controller.go: model.Status.CacheKey != "" && r.ModelCachePath != ""
  • internal/controller/deployment_builder.go: useCache := model.Status.CacheKey != "" && r.ModelCachePath != ""

The chart only emits the --model-cache-* flags when enabled: true, so when disabled the operator falls back to the non-empty /models default and keeps provisioning + mounting the cache (a shared 100Gi PVC) anyway.

Fix

Emit an explicit empty --model-cache-path= in the disabled branch so the controller's path != "" gate evaluates false and caching is actually off.

Test

Added a helm-unittest regression case to tests/model-cache_test.yaml asserting that with modelCache.enabled: false the deployment passes --model-cache-path= (empty), no --model-cache-path=/models, and no /models volume mount. Full suite passes (10/10).

@eleboucher eleboucher requested a review from Defilan as a code owner June 22, 2026 08:50
@eleboucher eleboucher force-pushed the fix/model-cache-disable-flag branch from 8fea714 to b3b54c1 Compare June 22, 2026 08:51
Signed-off-by: Erwan Leboucher <erwanleboucher@gmail.com>
@eleboucher eleboucher force-pushed the fix/model-cache-disable-flag branch from b3b54c1 to a1dc134 Compare June 22, 2026 08:52
@eleboucher

Copy link
Copy Markdown
Contributor Author

Btw you shouldn't put the github actions to run unless you approve it, to prevent from cache poisoning and attacker getting your secrets

@Defilan

Defilan commented Jun 22, 2026

Copy link
Copy Markdown
Member

Thanks for this contribution! Good callout with actions. I set up the initial policy when the project was smaller that I had to approve actions for new contributors but allow it for returning ones. Now that the project has grown, it's worth revisiting that. Appreciate your callout on this.

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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