Repository navigation
fix(api): keep CRD-only fields through edits, cap inline JSON sources, restart 409, safe owner label - #96
Merged
Conversation
…, restart 409, safe owner label - Models carry what the CRD allows: env[].valueFrom, runtime.keepAlive and any resource name (ephemeral-storage, nvidia.com/gpu, claims). - PATCH merges `runtime` and `access` field by field: fields the request leaves out keep their stored value (null/empty removes one), so a UI or MCP edit no longer drops what kubectl or GitOps set. The UI form carries resource names it does not edit, sends null to clear, and shows a valueFrom variable read-only. - POST and PATCH (and so launch_app) return 413 when inline files exceed MAX_UPLOAD_BYTES, the cap uploads already had. - restart returns 409 for a stopped app (replicas 0), as documented. - The owner label is written only when the username is a valid label value; spec.owner stays the owner, so `a@b.c` can create and edit apps. Event matching by exact child names already landed in #82. Closes #57 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016pvMUQJoLkBDk6B94TTm45
|
📄 Docs preview for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #57.
What changed
EnvVargainsvalueFrom.runtimegainskeepAlive.Resourcestakes any resource name (ephemeral-storage,nvidia.com/gpu, …, plusclaimsthroughextra="allow") instead of only cpu and memory.runtimeandaccessfield by field (based on Pydantic'smodel_fields_set):nullor empty removes it.PATCH {"runtime": {"replicas": 3}}no longer wipes env, resources orkeepAlive.sourceis still replaced whole, since switching source type needs that.resources: nullto clear (an omitted field is now kept). It also shows avalueFromvariable read-only ("from secret site/token") instead of an empty box that would wipe it on save.POSTandPATCHwithsource.inline.filesoverMAX_UPLOAD_BYTESnow return 413, the same cap uploads already had, counted the same way (content bytes).launch_appsurfaces it.restarton a stopped app (replicas: 0) returns 409, as the API reference already promised, instead of rolling nothing and returning 200.apps.nebari.dev/owneris written only when the username is a valid label value.spec.ownerwas already the owner of record and the label only a fallback. Rewritinga@b.cinto a label could collide with another user's name and hand them the fallback ownership, so such usernames simply get no label.Event matching is already fixed. Matching events by exact child names landed in #82:
app_eventsuses field selectors onapp-<name>, the pods and their ReplicaSets, soapp-foono longer matchesapp-foobar.Testing
tests/test_model_fidelity.pycovers:valueFrom,keepAliveand extra resource names survivePATCH {displayName},PATCH {runtime: {replicas}}and a UI-style GET→PATCH round trip.env: []andresources: nullclear their field.a@b.cuser creates and edits their app.launch_appover the cap → 413, nothing created).a@b.c, owner checks on):a@b.c201;spec.owner: a@b.c, only the subdomain labelkubectl patch:keepAlive,env[].valueFrom(fieldRef),ephemeral-storagerequestPATCH displayName,PATCH runtime.replicas=2, GET→PATCH round trip200; stored runtime still haskeepAlive,valueFrom,ephemeral-storage, andreplicas: 2printenv POD→ the pod name (valueFrom reached the workload)409413 … over the 921600-byte capAfterwards the cluster was restored: the test App deleted, original image, sync back on.
🤖 Generated with Claude Code
https://claude.ai/code/session_016pvMUQJoLkBDk6B94TTm45