-
Notifications
You must be signed in to change notification settings - Fork 950
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
feature: finish upgrade interface #923
feature: finish upgrade interface #923
Conversation
c3f1390
to
2f087b2
Compare
Codecov Report
@@ Coverage Diff @@
## master #923 +/- ##
==========================================
- Coverage 13.06% 12.92% -0.15%
==========================================
Files 123 123
Lines 8235 8325 +90
==========================================
Hits 1076 1076
- Misses 7063 7153 +90
Partials 96 96
Continue to review full report at Codecov.
|
Thanks a lot for the work you made. I am wondering adding some integration test will guarantee this much better. @HusterWan 💟 |
2f087b2
to
938d668
Compare
938d668
to
a501cd6
Compare
daemon/mgr/container.go
Outdated
// check the image existed or not, and convert image id to image ref | ||
image, err := mgr.ImageMgr.GetImage(ctx, config.Image) | ||
if err != nil { | ||
return errors.Wrap(err, "get image failed") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failed to get image
if len(image.RepoTags) > 0 { | ||
ref = image.RepoTags[0] | ||
} else { | ||
ref = image.RepoDigests[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there possibility that this image.RepoDigests
has a length of 0?
also ping @YaoZengzeng @zeppp
daemon/mgr/container.go
Outdated
if needRollback { | ||
c.meta = &backupContainerMeta | ||
if err := mgr.Client.CreateSnapshot(ctx, c.ID(), c.meta.Image); err != nil { | ||
logrus.Errorf("Upgrade rollback failed to create snapshot: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failed to create snapshot when rollback upgrade: %v
daemon/mgr/container.go
Outdated
time.Sleep(100 * time.Millisecond) | ||
|
||
msg, err := mgr.Client.GetSnapshot(ctx, c.ID()) | ||
logrus.Info("snapshots %+v", msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If err != nil, just double check whether msg has data in itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if error occured , msg will be a empty Snapshot.Info{}
test/cli_upgrade_test.go
Outdated
command.PouchRun("run", "-d", "--name", name, busyboxImage).Assert(c, icmd.Success) | ||
|
||
res := command.PouchRun("upgrade", "--name", name, busyboxImage) | ||
c.Assert(res.Error, check.IsNil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering if we do not upgrade anything, should we return an error indicating nothing to upgrade
and no status update happens in daemon side. @HusterWan WDYT
a501cd6
to
ca2c657
Compare
CI fails:
|
Signed-off-by: Michael Wan <zirenwan@gmail.com>
ca2c657
to
c26160c
Compare
LGTM |
Yes, i will add the doc after i have a tiime, but i will create a issue to reminder me. |
Signed-off-by: Michael Wan zirenwan@gmail.com
Ⅰ. Describe what this PR did
finish upgrade interface daemon part
Ⅱ. Does this pull request fix one issue?
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews