-
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
bugfix: fix lease used by pouchd may be expired #2820
bugfix: fix lease used by pouchd may be expired #2820
Conversation
Signed-off-by: Michael Wan <zirenwan@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #2820 +/- ##
==========================================
- Coverage 69.34% 67.92% -1.43%
==========================================
Files 278 278
Lines 17428 17448 +20
==========================================
- Hits 12085 11851 -234
- Misses 3994 4247 +253
- Partials 1349 1350 +1
|
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.
LGTM
@@ -86,8 +90,13 @@ func NewClient(opts ...ClientOpt) (APIClient, error) { | |||
insecureRegistries: copts.insecureRegistries, | |||
} | |||
|
|||
lease, err := client.preparePouchdLease(copts.rpcAddr, copts.defaultns) | |||
if err != nil { | |||
return nil, fmt.Errorf("failed to prepare a lease for pouchd") |
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.
why not to print the detailed err
in the returned err? @HusterWan @fuweid
Signed-off-by: Michael Wan zirenwan@gmail.com
Ⅰ. Describe what this PR did
In containerd 1.2.5
WithLease
add a default expire time, so when pouchd starting, it will got a lease with expire time, so the pouchd will got errors calling containerd API when the lease expired.So we create a named lease that is
pouchd.lease
. when pouchd starting , we just fetch the named lease and make sure the lease do not have expire label.Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews