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

Update state after update #1558

Merged
merged 1 commit into from
Aug 15, 2017
Merged

Update state after update #1558

merged 1 commit into from
Aug 15, 2017

Conversation

hqhq
Copy link
Contributor

@hqhq hqhq commented Aug 15, 2017

state.json should be a reflection of the container's
realtime state, including resource configurations,
so we should update state.json after updating container
resources.

Signed-off-by: Qiang Huang [email protected]

state.json should be a reflection of the container's
realtime state, including resource configurations,
so we should update state.json after updating container
resources.

Signed-off-by: Qiang Huang <[email protected]>
@crosbymichael
Copy link
Member

crosbymichael commented Aug 15, 2017

LGTM

Approved with PullApprove

1 similar comment
@mrunalp
Copy link
Contributor

mrunalp commented Aug 15, 2017

LGTM

Approved with PullApprove

@mrunalp mrunalp merged commit b31bdfc into opencontainers:master Aug 15, 2017
@hqhq hqhq deleted the update_state branch August 16, 2017 01:26
@@ -186,8 +186,17 @@ func (c *linuxContainer) Set(config configs.Config) error {
if status == Stopped {
return newGenericError(fmt.Errorf("container not running"), ContainerNotRunning)
}
if err := c.cgroupManager.Set(&config); err != nil {
// Set configs back
if err2 := c.cgroupManager.Set(c.config); err2 != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure about external users of libcontainer, but runc's own update.go modifies container config in place, meaning &config and c.config is exactly the same thing, meaning this "rollback" does not make sense.

@hqhq do you remember why you introduced it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kolyshkin Libcontainer was supposed to be used without runc, so the config parameter can be different from c.config, if I remember right, before I added runc update, docker was using this Set function of libcontainer directly for docker update, this rollback was valid at that time.

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

Successfully merging this pull request may close these issues.

4 participants