Orchestrate eject: preflight, config strip, Mimir cleanup#265
Orchestrate eject: preflight, config strip, Mimir cleanup#265timtalbot wants to merge 10 commits into
Conversation
…r cleanup Wire up the full eject flow for --dry-run=false: preflight validation, control room config snapshot, ptd.yaml field stripping, Mimir password deletion from the control room secret store, and eject record generation. Closes #248
# Conflicts: # lib/eject/eject.go
|
@claude review |
|
Claude finished @timtalbot's task —— View job Code Review:
|
Address review feedback on #265: remove unused Bundle type and variable from eject.Run, and wrap os.WriteFile calls in tests with require.NoError for fail-fast on setup errors.
ebaafc7 to
ecaaf70
Compare
…anup GetSecretValue now wraps cloud-specific not-found errors with a types.ErrSecretNotFound sentinel. RemoveWorkloadMimirPassword reads the secret directly and treats only a genuine not-found as a no-op success, returning any other error (e.g. AccessDenied) so the eject record reflects mimir_secret_removed:false instead of a false success.
StripControlRoomFields and writeEjectRecord now write to a temp file in the same directory and os.Rename it into place, so a crash mid-write leaves the original file intact instead of a truncated/corrupt one. File permissions are preserved (ptd.yaml 0644, eject-record 0600).
Write the eject-record (containing the control-room snapshot) to disk right after taking the snapshot, before stripping ptd.yaml, then rewrite it with final per-step outcomes once the steps complete. If the process dies after the strip but before the final write, the snapshot survives on disk so a re-run can recover instead of failing preflight.
buildConnections derived the mimir-auth secret name from a separately threaded control room target name, which is empty in the dry-run path (the default), producing a malformed '.mimir-auth.posit.team' in the customer handoff doc. Derive it from ControlRoomClusterName instead, which is populated in both dry-run and live paths, and drop the now redundant controlRoomName parameter.
…ct rename Target.Credentials already refreshes internally, so the explicit creds.Refresh call in the preflight credential checks was a guaranteed no-op; remove it. Also complete the severance->eject terminology rename in the handoff doc: '## Eject Plan' header and ejectPlanDryRun/ ejectPlanLive template funcs and text helpers.
|
@claude review |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
@claude review |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
@claude review |
|
Claude finished @timtalbot's task in 3m 33s —— View job Code Review:
|
Summary
Wires up the full
ptd eject --dry-run=falseflow, turning the eject command from a documentation-only tool into one that actually disconnects the workload from the control room.control_room_*fields exist in config before proceedingeject-record.jsoncapturing what happened (snapshot, timestamps, success/failure of each step)sever→eject/removalthroughout;sever.go→mimir.gomimir.go)Test plan
Closes #248