File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 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 {
306306 }
307307
308308 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+ }
310313 c .observingCh <- cloneID
311314
312315 c .SaveClonesState ()
Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ func (c *Base) fetchSnapshots() error {
3434 numClones := 0
3535
3636 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 {
3839 numClones ++
3940 }
4041 }
Original file line number Diff line number Diff line change @@ -62,10 +62,12 @@ func (c *Base) restartCloneContainers(ctx context.Context) {
6262
6363 if err := c .provision .ReconnectClone (ctx , cloneName ); err != nil {
6464 log .Err (fmt .Sprintf ("Clone container %s cannot be reconnected to the internal network: %s" , cloneName , err ))
65+ continue
6566 }
6667
6768 if err := c .provision .StartCloneContainer (ctx , cloneName ); err != nil {
6869 log .Err (fmt .Sprintf ("Clone container %s cannot start: %s" , cloneName , err ))
70+ continue
6971 }
7072
7173 log .Dbg (fmt .Sprintf ("Clone container %s is running" , cloneName ))
@@ -79,7 +81,8 @@ func (c *Base) filterRunningClones(ctx context.Context) {
7981 snapshotCache := make (map [string ]struct {})
8082
8183 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 {
8386 delete (c .clones , cloneID )
8487 continue
8588 }
You can’t perform that action at this time.
0 commit comments