Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: make sure SnapshotID not empty when start container #2678

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion daemon/mgr/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,10 +761,11 @@ func (mgr *ContainerManager) createContainerdContainer(ctx context.Context, c *C
IO: mgr.IOs.Get(c.ID),
RootFSProvided: c.RootFSProvided,
BaseFS: c.BaseFS,
SnapshotID: c.SnapshotID,
Copy link
Contributor

@Ace-Tang Ace-Tang Jan 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I check that snapshot id is first given to SnapshotID , snapID := id, SnapshotID: snapID, so why this field will be empty , if this happened, do c.SnapshotKey() will also be empty

Copy link
Contributor Author

@HusterWan HusterWan Jan 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I check that snapshot id is first given to SnapshotID , snapID := id, SnapshotID: snapID, so why this field will be empty

I also cannot figure it out why this happened, maybe some extreme cases

if this happened, do c.SnapshotKey() will also be empty

No, SnapshotKey() will return c.ID if the SnapshotID is empty

UseSystemd: mgr.Config.UseSystemd(),
}
c.Unlock()
// make sure the SnapshotID got a proper value
ctrdContainer.SnapshotID = c.SnapshotKey()

if checkpointID != "" {
checkpointDir, err = mgr.getCheckpointDir(c.ID, checkpointDir, checkpointID, false)
Expand Down