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

feature: add CRI interface of start podsandbox #2237

Merged
merged 1 commit into from
Sep 14, 2018

Conversation

starnop
Copy link
Contributor

@starnop starnop commented Sep 12, 2018

Signed-off-by: Starnop [email protected]

Ⅰ. Describe what this PR did

Support to the ability to get the same IP after restart the PodSandbox.
Scenario: It will fail to get IP after PodSandbox restarts because of the external factors such as shutdown the host.

Ⅱ. Does this pull request fix one issue?

None.

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

None.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

The work of tests rely on the tools of CRI-tools, in the meantime, CRI-tools imports the project of alibaba/pouch. So add the interface related, and hope to be merged ASAP, I will finish the details in the next Pull Request.

@CLAassistant
Copy link

CLAassistant commented Sep 12, 2018

CLA assistant check
All committers have signed the CLA.

@starnop starnop force-pushed the cri-StartPodSandbox branch 3 times, most recently from ab4cd0b to d0a559b Compare September 12, 2018 16:05
@codecov-io
Copy link

codecov-io commented Sep 12, 2018

Codecov Report

Merging #2237 into master will decrease coverage by 0.14%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2237      +/-   ##
==========================================
- Coverage   66.56%   66.41%   -0.15%     
==========================================
  Files         208      208              
  Lines       16756    16782      +26     
==========================================
- Hits        11153    11146       -7     
- Misses       4276     4310      +34     
+ Partials     1327     1326       -1
Flag Coverage Δ
#criv1alpha1test 32.94% <0%> (ø) ⬆️
#criv1alpha2test 33.64% <33.33%> (+0.18%) ⬆️
#integrationtest 39.86% <0%> (-0.06%) ⬇️
#nodee2etest 33.52% <33.33%> (-0.17%) ⬇️
#unittest 23.81% <0%> (-0.05%) ⬇️
Impacted Files Coverage Δ
cri/v1alpha2/cri_wrapper.go 63.56% <0%> (-0.88%) ⬇️
cri/v1alpha2/cri.go 70.19% <5.88%> (-1.7%) ⬇️
cri/v1alpha2/cri_utils.go 90.37% <70%> (-0.62%) ⬇️
cri/ocicni/cni_manager.go 65% <0%> (-15%) ⬇️
daemon/mgr/snapshot.go 89.85% <0%> (-4.35%) ⬇️
ctrd/image.go 76.75% <0%> (-2.2%) ⬇️
daemon/containerio/container_io.go 74.58% <0%> (-1.11%) ⬇️
daemon/mgr/container.go 57.59% <0%> (-0.21%) ⬇️
ctrd/container.go 60.23% <0%> (+0.47%) ⬆️
... and 3 more

string pod_sandbox_id = 1;
}

message StartPodSandboxResponse {}
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the last char

if err != nil {
return nil, err
}
netnsPath, err := c.getNetnsPath(ctx, id, config.GetLinux().GetSecurityContext().GetNamespaceOptions().GetNetwork(), config)
Copy link
Collaborator

Choose a reason for hiding this comment

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

modify the function's name, it will misunderstanding

@starnop starnop force-pushed the cri-StartPodSandbox branch 3 times, most recently from 40d9b29 to 4331f4a Compare September 13, 2018 04:20
@starnop starnop changed the title [WIP] feature: start podsandbox stopped forced feature: start podsandbox stopped forced Sep 13, 2018
@starnop starnop force-pushed the cri-StartPodSandbox branch from 4331f4a to c9101ea Compare September 14, 2018 01:45
@starnop starnop changed the title feature: start podsandbox stopped forced feature: add CRI interface of start podsandbox Sep 14, 2018
@starnop starnop force-pushed the cri-StartPodSandbox branch from c9101ea to c9e31fb Compare September 14, 2018 03:40
@@ -56,6 +56,20 @@ func (c *CriWrapper) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
return c.CriManager.RunPodSandbox(ctx, r)
}

// StartPodSandbox start a sandbox pod which was forced to stop by external factors.
// Network plugin returns same IPs when input same pod names and namespaces
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm... the comment seems wired to me 😂

Maybe the comment like this is more natural:

StartPodSandbox restart a sandbox pod which was stopped by accident and we should reconfigure it with network plugin which will make sure it reacquire its original network configuration, like IP address.

@starnop @fuweid WDYT?

If it make any sense, please update other docs as well :)

Copy link
Contributor

Choose a reason for hiding this comment

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

agree

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Has been updated. ^_^

@starnop starnop force-pushed the cri-StartPodSandbox branch from c9e31fb to 962b3f2 Compare September 14, 2018 05:32
Copy link
Contributor

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM and wait for CI

@YaoZengzeng
Copy link
Contributor

LGTM as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants