Skip to content

fix: let resource readers read its status - #479

Merged
scotwells merged 1 commit into
mainfrom
fix/status-read-permissions
Oct 16, 2026
Merged

scotwells merged 1 commit into
mainfrom
fix/status-read-permissions

Conversation

@scotwells

Copy link
Copy Markdown
Contributor

People who can view compute resources are refused their status, because the platform now checks a separate permission for status reads and no compute role grants it. The portal and CLI show permission errors where they should show workload, instance and catalog health. This grants status read to every role that can already read the resource, so viewing a resource includes viewing its status again. Status writes and scaling stay out of reach for users.

Changes

  • Compute Viewer gains status.get for workloads, workload deployments, instances, runtime classes, instance types, console sessions and quota allowance buckets, each placed directly after the matching get.
  • Instance Type Viewer gains instancetypes/status.get.
  • Compute Admin and Instance Type Staff Admin pick these up through inheritance.
  • Status update and patch stay controller-only. The workloaddeployments/scale subresource is deliberately not granted; that is a separate product decision.

User-facing effect

A project member with Compute Viewer now gets the object back instead of a 403:

GET /apis/compute.datumapis.com/v1alpha/namespaces/default/workloads/web/status

Before:

User "alice@example.com" cannot get resource "workloads/status" in API group "compute.datumapis.com"

PUT or PATCH on the same /status path is still denied.

Test plan

  • go test ./test/iam/... passes, including the guard that roles grant no subresource writes
  • kustomize build config/components/iam renders
  • After staging rolls, a Compute Viewer can GET a workload's and an instance's /status
  • After staging rolls, a status PATCH by the same user is still denied

Milo now authorizes subresource requests on their own permission, with no
fallback to the parent resource's get. The compute roles never granted
status.get, so anyone who could read a Workload, WorkloadDeployment,
Instance, InstanceType, RuntimeClass, InstanceConsoleSession or
AllowanceBucket was refused that object's status endpoint, even though a
plain get already returns the same status.

Key changes:
- grant status.get next to every get in Compute Viewer and Instance Type
  Viewer, so admins and staff admins inherit it
- leave status update and patch controller-only
- leave the workloaddeployments scale subresource ungranted
@scotwells
scotwells marked this pull request as ready for review October 15, 2026 18:57
@scotwells
scotwells requested a review from a team as a code owner October 15, 2026 18:57
@scotwells
scotwells merged commit 2568556 into main Oct 16, 2026
12 of 13 checks passed
@scotwells
scotwells deleted the fix/status-read-permissions branch October 16, 2026 14:56
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