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: we should get a container's execids from inspect #2699

Merged
merged 1 commit into from
Jan 30, 2019

Conversation

HusterWan
Copy link
Contributor

Signed-off-by: Michael Wan zirenwan@gmail.com

Ⅰ. Describe what this PR did

Now we cannot get a container's execids from inspect interface, So I opened this pull request tries to fix this problem. Now we can get the execids:

#  pouch inspect -f {{.ExecIds}} b63f88
[27573dc84a363456df62ac26a6258536c8c989a87bf9cbbe95c0adf9619f1c36]

But this solution has a problem, the execids of container's memory data or meta.json file may be incorrect, because we only update a container's execids when we call Get Container API.

So we can ensure the API's data is correct, but the data in memory or file may incorrect, this solution may not be best, we can discuss it. How about extend the interface:

// before
Get(ctx context.Context, name string) (*Container, error)

// after changed, execids not stored in ContainerJSON, but by api interface
Get(ctx context.Context, name string) (*Container, []string, error)

Ⅱ. Does this pull request fix one issue?

fixes: #2697

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

add unit test TestSafeMapValues
add an integration test TestContainerInspectExecIds

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov
Copy link

codecov bot commented Jan 28, 2019

Codecov Report

Merging #2699 into master will increase coverage by 1.18%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2699      +/-   ##
==========================================
+ Coverage   67.53%   68.72%   +1.18%     
==========================================
  Files         278      278              
  Lines       17409    17593     +184     
==========================================
+ Hits        11758    12090     +332     
+ Misses       4330     4176     -154     
- Partials     1321     1327       +6
Flag Coverage Δ
#criv1alpha2_test 39.27% <56.25%> (ø) ⬆️
#integration_test_0 36.35% <100%> (+0.05%) ⬆️
#integration_test_1 35.28% <81.25%> (+0.06%) ⬆️
#integration_test_2 36.38% <100%> (?)
#integration_test_3 35.2% <81.25%> (+0.07%) ⬆️
#node_e2e_test 35.04% <93.75%> (ø) ⬆️
#unittest 27.42% <18.75%> (-0.01%) ⬇️
Impacted Files Coverage Δ
daemon/mgr/container_types.go 72.85% <ø> (ø) ⬆️
pkg/collect/safe_map.go 100% <100%> (ø) ⬆️
daemon/mgr/container.go 59.7% <100%> (+1.09%) ⬆️
apis/server/container_bridge.go 90.44% <100%> (+1.71%) ⬆️
daemon/mgr/events.go 85.43% <0%> (-14.57%) ⬇️
cri/ocicni/cni_manager.go 58.82% <0%> (-11.77%) ⬇️
cri/v1alpha2/cri_utils.go 76.79% <0%> (-11.32%) ⬇️
pkg/streams/utils.go 82.14% <0%> (-9.53%) ⬇️
daemon/mgr/container_state.go 89.71% <0%> (-1.77%) ⬇️
cri/v1alpha2/cri.go 71.28% <0%> (-0.65%) ⬇️
... and 32 more

@pouchrobot pouchrobot added areas/test kind/bug This is bug report for project size/L labels Jan 28, 2019
daemon/mgr/container.go Outdated Show resolved Hide resolved
Signed-off-by: Michael Wan <zirenwan@gmail.com>
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas/test kind/bug This is bug report for project size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] pouch inspect -f {{.ExecIDs}} returned error
3 participants