Allow admins to create and reassign containers for other users#410
Conversation
…me param - POST /containers: admin can pass `username` body field to create container attributed to another user; validates user exists (404 if not found) - PUT /containers/:id: admin can pass `username` body field to reassign container ownership to another user; validates user exists (404 if not found) - Import User model in containers.js for existence validation - Document both fields in openapi.v1.yaml with admin-only descriptions
There was a problem hiding this comment.
Pull request overview
This PR extends the containers API to let admins (only) set or change a container’s owner by passing a username in the request body, and documents the new field in the OpenAPI spec.
Changes:
- Added
usernamerequest-body support toPOST /sites/:siteId/containersto create containers on behalf of another user. - Added
usernamerequest-body support toPUT /sites/:siteId/containers/:idto reassign container ownership (only when changed). - Updated
openapi.v1.yamlto document the newusernamefield and related 403 behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| create-a-container/routers/api/v1/containers.js | Adds request parsing and ownership assignment/reassignment via optional username. |
| create-a-container/openapi.v1.yaml | Documents username on create/update container endpoints and updates 403 responses accordingly. |
…tibility Podman builds default to the OCI image format, which silently drops the HEALTHCHECK from images/proxmox-ve/Dockerfile. Without it the proxmox service never reports healthy and bootstrap-manager's service_healthy condition can never be met. Declaring the same healthcheck at the compose level applies it at container create time, independent of the image format.
The PUT handler now pushes the new owner as the Proxmox tag ( |


Admins can now create containers attributed to other users (or reassign ownership of existing containers) by passing
usernamein the request body. API-only — no UI changes.Changes
POST /sites/:siteId/containers— admins may passusernameto set the container owner to a different user (validated against the Users table; 404 if not found). Non-admins continue to own their own containers.PUT /sites/:siteId/containers/:id— admins may passusernameto reassign container ownership. Only updates if the username differs from the current owner.Usermodel imported incontainers.jsfor pre-insert existence checks.usernamefield on both endpoints, marked admin-only.Example