File tree 3 files changed +10
-3
lines changed
3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -306,7 +306,10 @@ func (c *Base) DestroyClone(cloneID string) error {
306
306
}
307
307
308
308
c .deleteClone (cloneID )
309
- c .decrementCloneNumber (w .Clone .Snapshot .ID )
309
+
310
+ if w .Clone .Snapshot != nil {
311
+ c .decrementCloneNumber (w .Clone .Snapshot .ID )
312
+ }
310
313
c .observingCh <- cloneID
311
314
312
315
c .SaveClonesState ()
Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ func (c *Base) fetchSnapshots() error {
34
34
numClones := 0
35
35
36
36
for cloneName := range c .clones {
37
- if c .clones [cloneName ] != nil && c .clones [cloneName ].Clone .Snapshot .ID == entry .ID {
37
+ if c .clones [cloneName ] != nil && c .clones [cloneName ].Clone .Snapshot != nil &&
38
+ c .clones [cloneName ].Clone .Snapshot .ID == entry .ID {
38
39
numClones ++
39
40
}
40
41
}
Original file line number Diff line number Diff line change @@ -62,10 +62,12 @@ func (c *Base) restartCloneContainers(ctx context.Context) {
62
62
63
63
if err := c .provision .ReconnectClone (ctx , cloneName ); err != nil {
64
64
log .Err (fmt .Sprintf ("Clone container %s cannot be reconnected to the internal network: %s" , cloneName , err ))
65
+ continue
65
66
}
66
67
67
68
if err := c .provision .StartCloneContainer (ctx , cloneName ); err != nil {
68
69
log .Err (fmt .Sprintf ("Clone container %s cannot start: %s" , cloneName , err ))
70
+ continue
69
71
}
70
72
71
73
log .Dbg (fmt .Sprintf ("Clone container %s is running" , cloneName ))
@@ -79,7 +81,8 @@ func (c *Base) filterRunningClones(ctx context.Context) {
79
81
snapshotCache := make (map [string ]struct {})
80
82
81
83
for cloneID , wrapper := range c .clones {
82
- if wrapper .Clone == nil || wrapper .Session == nil || wrapper .Clone .Status .Code == models .StatusFatal {
84
+ if wrapper .Clone == nil || wrapper .Clone .Snapshot == nil || wrapper .Session == nil ||
85
+ wrapper .Clone .Status .Code == models .StatusFatal {
83
86
delete (c .clones , cloneID )
84
87
continue
85
88
}
You can’t perform that action at this time.
0 commit comments