cleanup.go RawHistoryFolder
1package domain
2
3// CleanupReport describes the result of reconciling runtime state after a
4// configuration entity was removed. Fields are additive-only for CLI/API JSON
5// consumers; callers should tolerate unknown future fields.
6type CleanupReport struct {
7 Domain string `json:"domain"`
8 RemovedContainers []CleanupContainer `json:"removed_containers"`
9 PreservedVolumes []CleanupVolume `json:"preserved_volumes"`
10 PreservedAttachments []CleanupAttachment `json:"preserved_attachments"`
11 OrphanedEntities []CleanupOrphanedEntity `json:"orphaned_entities"`
12 Warnings []string `json:"warnings"`
13 Hints []string `json:"hints"`
14 PartialFailures []CleanupFailure `json:"partial_failures"`
15}
16
17// CleanupContainer identifies a container affected by cleanup.
18type CleanupContainer struct {
19 ID string `json:"id"`
20 Name string `json:"name"`
21 Image string `json:"image"`
22 Status string `json:"status"`
23}
24
25// CleanupVolume identifies stateful data intentionally preserved by cleanup.
26type CleanupVolume struct {
27 Name string `json:"name"`
28 ContainerPath string `json:"container_path,omitempty"`
29 Reason string `json:"reason,omitempty"`
30}
31
32// CleanupAttachment identifies an attachment intentionally preserved or kept for
33// explicit follow-up cleanup.
34type CleanupAttachment struct {
35 Name string `json:"name"`
36 Image string `json:"image"`
37 ContainerID string `json:"container_id"`
38 Status string `json:"status"`
39 Owner string `json:"owner,omitempty"`
40 Reason string `json:"reason,omitempty"`
41}
42
43// CleanupOrphanedEntity identifies runtime state not currently configured.
44type CleanupOrphanedEntity struct {
45 Kind string `json:"kind"`
46 ID string `json:"id,omitempty"`
47 Name string `json:"name,omitempty"`
48 Status string `json:"status,omitempty"`
49 Reason string `json:"reason,omitempty"`
50}
51
52// CleanupFailure records non-fatal cleanup failures that require follow-up.
53type CleanupFailure struct {
54 Action string `json:"action"`
55 Kind string `json:"kind"`
56 ID string `json:"id,omitempty"`
57 Name string `json:"name,omitempty"`
58 Error string `json:"error"`
59}