Repository navigation
Description
Summary
Default VM images are visible only to the root tenant. Child tenants see an empty image list in the VM create form, so they cannot pick a default golden image.
Mechanism
The image picker reads PersistentVolumeClaims directly from the cozy-public namespace:
apps/console/src/components/SourceField.tsx—useImageOptions()callsuseK8sListwith a hardcodednamespace: "cozy-public"and filters PVCs by thevm-default-images-prefix.
The console talks to the Kubernetes API as the logged-in user, so this list is subject to that user's RBAC. The default golden images are provisioned as PVCs/DataVolumes in cozy-public (platform vm-default-images package), but the shared tenant role bound in that namespace (cozy:tenant:dashboard) grants read only on Flux helmrepositories/helmcharts — not on persistentvolumeclaims. So a child-tenant identity gets an empty/forbidden list and sees no images, while the root-tenant identity (broader access) sees them. Hence the asymmetry.
Suggested fix
Serve the image list the same way storage classes, VM disks and instance types are now served — through the privileged, server-side Option resource (core.cozystack.io) introduced in #2778 — instead of a direct PVC read from cozy-public:
- Add an
Optionsource (e.g.vmImage) computed server-side with privileged access, listing thevm-default-images-*entries fromcozy-public. - Annotate the image field in the VM schema with
x-cozystack-optionsso it renders viaDynamicOptionsWidget. - Drop the bespoke
useImageOptionsPVC read inSourceField.tsx.
This routes around the tenant RBAC entirely (tenants need no read on cozy-public PVCs) and matches the pattern the rest of the form already uses. This depends on a backend Option source, mirroring how the dropdown migration in cozystack/cozystack-ui#30 depended on #2778.
Source
A user reported that the images of the default image package are only visible to the root tenant, not to child tenants.
Activity
myasnikovdaniil commentedon Aug 15, 2026
Closing, fixed by bb32213 on 2026-06-08. It adds a Role granting tenants read on
persistentvolumeclaimsincozy-public, with a helm-unittest pinning it. The commit message describes this exact symptom: a 403 and an empty dropdown.