B2b: decommission orchestration + missing-storage indicator + re-enroll fix (v0.65.0)
agentapi.Decommission + handleStorageDecommission (migrate-all-or-none, Change 2): migrate-then-decommission via the migration done-hook, or decommission-anyway (stop apps, keep HDD_PATH). 'Hiányzó tárhely' badge on dashboard/stacks/app card when an app's drive is decommissioned/disconnected/absent. Change 4: registerStoragePath clears the decommissioned marker on re-enroll (ClearDecommissioned had no callers). Non-hollow tests incl. mutation-proven Change-4 companion. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -27,14 +27,15 @@ func TestTemplatesParse(t *testing.T) {
|
||||
|
||||
// mockAgent records calls so tests can assert the refusal path performs NO mount/destructive action.
|
||||
type mockAgent struct {
|
||||
disks agentapi.DisksResponse
|
||||
formatRes agentapi.FormatResult
|
||||
formatErr error
|
||||
assignErr error
|
||||
assignCalls []assignCall
|
||||
disksCalls int
|
||||
formatCalls []formatCall
|
||||
guestAttachCalls []string
|
||||
disks agentapi.DisksResponse
|
||||
formatRes agentapi.FormatResult
|
||||
formatErr error
|
||||
assignErr error
|
||||
assignCalls []assignCall
|
||||
disksCalls int
|
||||
formatCalls []formatCall
|
||||
guestAttachCalls []string
|
||||
decommissionCalls []string
|
||||
}
|
||||
|
||||
type assignCall struct{ uuid, where, fstype string }
|
||||
@@ -58,6 +59,10 @@ func (m *mockAgent) AssignDisk(_ context.Context, uuid, where, fstype, _ string)
|
||||
func (m *mockAgent) EjectDisk(_ context.Context, where string) (agentapi.EjectResult, error) {
|
||||
return agentapi.EjectResult{Ejected: where}, nil
|
||||
}
|
||||
func (m *mockAgent) Decommission(_ context.Context, where string) (agentapi.DecommissionResult, error) {
|
||||
m.decommissionCalls = append(m.decommissionCalls, where)
|
||||
return agentapi.DecommissionResult{Decommissioned: where}, nil
|
||||
}
|
||||
func (m *mockAgent) GuestAttach(_ context.Context, where string) error {
|
||||
m.guestAttachCalls = append(m.guestAttachCalls, where)
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user