Skip to content

Implement validating webhook for LLMModel - #19

Merged
dcmcand merged 1 commit into
mainfrom
task-4/validating-webhook
Mar 26, 2026
Merged

dcmcand merged 1 commit into
mainfrom
task-4/validating-webhook

Conversation

@dcmcand

@dcmcand dcmcand commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the validating webhook for LLMModel CRDs with:

  • Namespace label check: rejects LLMModels in namespaces without nebari.dev/managed=true
  • Subdomain generation: uses explicit subdomain or slugifies the model name
  • Subdomain collision detection: lists all LLMModels cluster-wide, rejects duplicates
  • DNS label length validation: rejects subdomains exceeding 63 chars
  • emptyDir + preload warning: warns (doesn't reject) about re-download risk
  • Self-exclusion on updates: a model's own subdomain doesn't count as a collision

Closes #4

Test plan

13 Ginkgo specs covering all validation paths:

  • cd operator && go test ./internal/webhook/... -v - all 13 specs pass
  • cd operator && make test - full suite passes (81.7% webhook coverage)

- Add client.Client field to LLMModelCustomValidator for API server access
- Validate that the LLMModel namespace has the nebari.dev/managed=true label
- Compute effective subdomain (explicit or Slugify(name)) and reject if >63 chars
- Reject subdomain collisions across all namespaces (excluding self on update)
- Warn when storage type is emptyDir with preload=true (re-download on restart)
- Delete validation always passes
- Table-driven Ginkgo tests covering all required cases (13 specs, all passing)
@dcmcand
dcmcand merged commit 898b94c into main Mar 26, 2026
1 check passed
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.

Implement validating webhook

1 participant