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 exec resize router #2105

Merged
merged 1 commit into from
Aug 21, 2018

Conversation

HusterWan
Copy link
Contributor

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

Ⅰ. Describe what this PR did

add exec resize router, this api is used by k8s exec

Ⅱ. 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

@codecov-io
Copy link

codecov-io commented Aug 16, 2018

Codecov Report

Merging #2105 into master will increase coverage by 4.64%.
The diff coverage is 6.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2105      +/-   ##
==========================================
+ Coverage   60.47%   65.12%   +4.64%     
==========================================
  Files         208      208              
  Lines       16411    16427      +16     
==========================================
+ Hits         9925    10698     +773     
+ Misses       5296     4402     -894     
- Partials     1190     1327     +137
Flag Coverage Δ
#criv1alpha1test 33.23% <6.25%> (?)
#criv1alpha2test 33.71% <6.25%> (-0.18%) ⬇️
#integrationtest 39.82% <6.25%> (ø) ⬆️
#unittest 23.88% <0%> (-0.03%) ⬇️
Impacted Files Coverage Δ
apis/server/exec_bridge.go 50.84% <0%> (-17.34%) ⬇️
apis/server/router.go 91.78% <100%> (+0.05%) ⬆️
daemon/logger/jsonfile/utils.go 71.54% <0%> (-1.63%) ⬇️
cri/v1alpha2/cri.go 64.29% <0%> (-0.34%) ⬇️
daemon/mgr/container.go 56.5% <0%> (+0.4%) ⬆️
cri/v1alpha1/cri_utils.go 83.64% <0%> (+23.06%) ⬆️
cri/criservice.go 64.7% <0%> (+24.99%) ⬆️
cri/v1alpha1/cri_wrapper.go 55.8% <0%> (+55.8%) ⬆️
cri/v1alpha1/cri.go 64.13% <0%> (+64.13%) ⬆️
cri/v1alpha1/server.go 79.84% <0%> (+79.84%) ⬆️
... and 3 more

apis/swagger.yml Outdated
description: "bad parameter"
schema:
$ref: "#/definitions/Error"
500:
Copy link
Collaborator

@allencloud allencloud Aug 16, 2018

Choose a reason for hiding this comment

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

I think here we have a 404 status code since errors.Wrap(errtypes.ErrNotfound, "exec process "+execid):

// GetExecConfig returns execonfig of a exec process inside container.
func (mgr *ContainerManager) GetExecConfig(ctx context.Context, execid string) (*ContainerExecConfig, error) {
	v, ok := mgr.ExecProcesses.Get(execid).Result()
	if !ok {
		return nil, errors.Wrap(errtypes.ErrNotfound, "exec process "+execid)
	}
	execConfig, ok := v.(*ContainerExecConfig)
	if !ok {
		return nil, fmt.Errorf("invalid exec config type")
	}
	return execConfig, nil
}

@@ -37,15 +38,29 @@ type HistoryResultItem struct {
// Required: true
EmptyLayer bool `json:"EmptyLayer"`

// ID of every layer image.
Copy link
Contributor

Choose a reason for hiding this comment

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

using different type swagger here? 🤔

Signed-off-by: Michael Wan <zirenwan@gmail.com>
@HusterWan
Copy link
Contributor Author

Any Advice? @allencloud @fuweid 😆

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 but @HusterWan we need test case in the following PR.

@fuweid fuweid merged commit 231613a into AliyunContainerService:master Aug 21, 2018
@HusterWan
Copy link
Contributor Author

@fuweid Yes Sir !

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.

5 participants