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

cri: add default annotation sandboxid #2254

Merged
merged 1 commit into from
Sep 20, 2018
Merged

cri: add default annotation sandboxid #2254

merged 1 commit into from
Sep 20, 2018

Conversation

Ace-Tang
Copy link
Contributor

for vm level runtime, add default annotation
io.kubernetes.cri-o.SandboxID when create container
in sanbox.

Signed-off-by: Ace-Tang aceapril@126.com

Ⅰ. Describe what this PR did

As for kata, the default annotation is

// CRIContainerTypeKeyList lists all the CRI keys that could define
    // the container type from annotations in the config.json.
    CRIContainerTypeKeyList = []string{criContainerdAnnotations.ContainerType, crioAnnotations.ContainerType, dockershimAnnotations.ContainerTypeLabelKey}

    // CRISandboxNameKeyList lists all the CRI keys that could define
    // the sandbox ID (sandbox ID) from annotations in the config.json.
    CRISandboxNameKeyList = []string{criContainerdAnnotations.SandboxID, crioAnnotations.SandboxID, dockershimAnnotations.SandboxIDLabelKey}

I also wonder whether cri mistake SandboxName as SandboxID as default annotation, @YaoZengzeng @starnop

specAnnotation[anno.SandboxName] = podSandboxID

Ⅱ. Does this pull request fix one issue?

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

no.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

for vm level runtime, add default annotation
io.kubernetes.cri-o.SandboxID when create container
in sanbox.

Signed-off-by: Ace-Tang <aceapril@126.com>
@codecov
Copy link

codecov bot commented Sep 19, 2018

Codecov Report

Merging #2254 into master will decrease coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2254      +/-   ##
==========================================
- Coverage   66.77%   66.72%   -0.06%     
==========================================
  Files         208      208              
  Lines       16923    16925       +2     
==========================================
- Hits        11301    11293       -8     
- Misses       4262     4266       +4     
- Partials     1360     1366       +6
Flag Coverage Δ
#criv1alpha1test 32.74% <100%> (+0.07%) ⬆️
#criv1alpha2test 35.97% <0%> (-0.04%) ⬇️
#integrationtest 39.43% <0%> (-0.07%) ⬇️
#nodee2etest 33.4% <0%> (-0.04%) ⬇️
#unittest 23.75% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
cri/v1alpha2/cri.go 66.46% <ø> (-0.25%) ⬇️
cri/v1alpha1/cri.go 61.85% <100%> (+0.06%) ⬆️
pkg/meta/store.go 62.5% <0%> (-1.57%) ⬇️
daemon/mgr/container_utils.go 83.13% <0%> (-1.21%) ⬇️
cri/v1alpha2/cri_wrapper.go 60% <0%> (-1.21%) ⬇️
ctrd/container.go 58.8% <0%> (-0.96%) ⬇️
daemon/mgr/snapshot.go 94.2% <0%> (+4.34%) ⬆️

@@ -14,6 +14,9 @@ const (
// SandboxName is the sandbox name annotation
SandboxName = "io.kubernetes.cri-o.SandboxName"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I think this shoud be SanboxID , but not SanboxName.

Copy link
Contributor

Choose a reason for hiding this comment

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

It will use SandboxName as sharedContainer for runv, please refer to https://github.com/hyperhq/runv/blob/master/cli/create.go#L96

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, since kata need SandboxID, just append it.

@allencloud allencloud changed the title cri: add default annotation sanboxid cri: add default annotation sandboxid Sep 19, 2018
@starnop
Copy link
Contributor

starnop commented Sep 19, 2018

LGTM.

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

@fuweid fuweid merged commit 545f303 into AliyunContainerService:master Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants