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 daemon update API #987

Merged

Conversation

allencloud
Copy link
Collaborator

Signed-off-by: Allen Sun allensun.shl@alibaba-inc.com

Ⅰ. Describe what this PR did

This PR adds POST /daemon/update API to make daemon be able to be updated.

Currently we can only update daemon's labels and image proxy. I encapsulate both two into a DaemonUpdateConfig struct and use this to pass through daemon and client.

This API has not a command line implementation yet.

Ⅱ. Does this pull request fix one issue?

fixes #983

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

see the integration test in code change api_daemon_update_test.go

Ⅴ. Special notes for reviews

none

@allencloud allencloud force-pushed the update-daemon-api branch 5 times, most recently from 9278b5c to ad8a7ed Compare March 29, 2018 01:43
@codecov-io
Copy link

codecov-io commented Mar 29, 2018

Codecov Report

Merging #987 into master will decrease coverage by 0.03%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #987      +/-   ##
==========================================
- Coverage   13.72%   13.68%   -0.04%     
==========================================
  Files         124      124              
  Lines        8367     8387      +20     
==========================================
  Hits         1148     1148              
- Misses       7120     7140      +20     
  Partials       99       99
Impacted Files Coverage Δ
daemon/mgr/system.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aaf1703...475cd57. Read the comment docs.

@allencloud allencloud force-pushed the update-daemon-api branch 2 times, most recently from 3e3b051 to c067255 Compare March 29, 2018 06:15
for _, newLabel := range cfg.Labels {
appearedKey := false
for i := 0; i < length; i++ {
newLabelSlice := strings.SplitN(newLabel, "=", 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

this line should put in upper for.

Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
@HusterWan
Copy link
Contributor

LGTM

@allencloud allencloud merged commit 8ac4b7c into AliyunContainerService:master Mar 29, 2018
@allencloud allencloud deleted the update-daemon-api branch March 29, 2018 07:34
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.

[proposal] add an API POST /daemon/update to update metadata of Pouch Daemon
4 participants