Repository navigation
fix: route restart --location through the Workload - #641
Merged
Merged
Conversation
A location-scoped restart wrote the restart annotation straight onto the workload's WorkloadDeployments. Project users may update Workloads but not WorkloadDeployments, so the command failed as forbidden. Even with that permission the edit would not hold, because the workload controller owns deployment specs and overwrites them on its next reconcile. The command now records the restart as a per-location annotation on the Workload, and the workload controller copies it onto the template of the deployments at that location only. A location restart needs the same permission as a full restart and rolls only that location. Key changes: - add location-restart.compute.datumapis.com/<location> on Workloads and the locationRestartedAt template annotation it maps to - stamp the template annotation on matching deployments in the controller - update the Workload from restart --location instead of its deployments
ecv
approved these changes
Nov 11, 2026
ecv
left a comment
Contributor
There was a problem hiding this comment.
Approve. A location restart is now a Workload annotation that the controller reads by exact key, only for locations the Workload's placements resolve to, and copies into one fixed template annotation of that location's deployment. It needs only Workload update, less than the old path, and cannot reach another location, Workload or project.
Follow-ups:
- The annotation is never cleared. A stale value does not re-roll, but deleting it later rolls that location once more. Clear it, or document that.
- restartLocation does a full Update of a Workload read earlier, so a concurrent edit returns 409 instead of retrying. A merge patch of the one annotation avoids that.
- The test covers one location; nothing tests a key naming a location the Workload does not place in.
kevwilliams
approved these changes
Nov 11, 2026
kevwilliams
left a comment
Contributor
There was a problem hiding this comment.
Verified the restart stamp lands on a deep-copied template inside the full-template hash, annotation-only Workload changes still reconcile, and it merges cleanly with #640.
3 of 4 tasks
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.
Requested by Scot Schuchert-Wells · project thread
Restarting one location of a workload failed with a permission error for project users, while restarting every location worked. The location restart edited the workload's deployments directly, which project users can't write, and which the workload controller overwrites on its next reconcile anyway. It now records the restart on the Workload itself, and the controller rolls only the deployments at that location. A location restart therefore needs the same permission as a full restart, with no RBAC change.
Fixes #487
How it works
restart --location <loc>setslocation-restart.compute.datumapis.com/<loc>(an RFC3339 timestamp) on the Workload's metadata, after checking the workload has a deployment there.compute.datumapis.com/locationRestartedAton the template of the deployments at that location only. It's part of the template hash, so it triggers the same ordered in-place roll as a full restart.Test plan
make testand golangci-lint passGenerated by Claude Code