Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4419)

Issue 73390043: LXC AutoRestart Setting

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 1 month ago by waigani
Modified:
10 years, 1 month ago
Reviewers:
mp+210117, thumper, hduran
Visibility:
Public.

Description

LXC AutoRestart Setting lxc.containerManager gains “autorestart bool”, and sets that from container.ManagerConfig, if not in container.ManagerConfig, then manager default is true. https://code.launchpad.net/~waigani/juju-core/lxc-autorestart-setting/+merge/210117 Requires: https://code.launchpad.net/~waigani/juju-core/managers-should-warn-for-any-unknown-options/+merge/210114 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 7

Patch Set 2 : LXC AutoRestart Setting #

Patch Set 3 : LXC AutoRestart Setting #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -5 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M container/lxc/lxc.go View 1 2 4 chunks +15 lines, -2 lines 2 comments Download
M container/lxc/lxc_test.go View 1 2 3 chunks +39 lines, -3 lines 2 comments Download
M provider/local/config.go View 1 2 1 chunk +5 lines, -0 lines 1 comment Download
M provider/local/environ.go View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 6
waigani
Please take a look.
10 years, 1 month ago (2014-03-10 03:43:39 UTC) #1
thumper
https://codereview.appspot.com/73390043/diff/1/container/lxc/lxc.go File container/lxc/lxc.go (right): https://codereview.appspot.com/73390043/diff/1/container/lxc/lxc.go#newcode47 container/lxc/lxc.go:47: autorestart bool normally camel case: "autoRestart" yes logdir is ...
10 years, 1 month ago (2014-03-10 03:56:48 UTC) #2
hduran
https://codereview.appspot.com/73390043/diff/1/container/lxc/lxc.go File container/lxc/lxc.go (right): https://codereview.appspot.com/73390043/diff/1/container/lxc/lxc.go#newcode70 container/lxc/lxc.go:70: } Wouldn't this whole block be equivalent to: autoRestart ...
10 years, 1 month ago (2014-03-17 17:42:23 UTC) #3
waigani
Please take a look. https://codereview.appspot.com/73390043/diff/1/container/lxc/lxc.go File container/lxc/lxc.go (right): https://codereview.appspot.com/73390043/diff/1/container/lxc/lxc.go#newcode47 container/lxc/lxc.go:47: autorestart bool On 2014/03/10 03:56:48, ...
10 years, 1 month ago (2014-03-18 00:37:24 UTC) #4
waigani
Please take a look.
10 years, 1 month ago (2014-03-18 17:54:34 UTC) #5
thumper
10 years, 1 month ago (2014-03-19 04:01:23 UTC) #6
I think we should hold off on the local provider changes until suspend and
resume are done.

https://codereview.appspot.com/73390043/diff/40001/container/lxc/lxc.go
File container/lxc/lxc.go (right):

https://codereview.appspot.com/73390043/diff/40001/container/lxc/lxc.go#newco...
container/lxc/lxc.go:93: autoRestart := conf["auto-restart"] == "" ||
conf["auto-restart"] == "true"
autoRestart, err := strconv.ParseBool(conf.PopValue("auto-restart"))
if err != nil {
  // An empty string is an error.
  autoRestart = true
}

https://codereview.appspot.com/73390043/diff/40001/container/lxc/lxc.go#newco...
container/lxc/lxc.go:97: logger.Warningf(`Found unused config option with key:
"%v" and value: "%v"`, k, v)
Please delete this.  It is now handled by the

  conf.WarnAboutUnused()

below.

https://codereview.appspot.com/73390043/diff/40001/container/lxc/lxc_test.go
File container/lxc/lxc_test.go (right):

https://codereview.appspot.com/73390043/diff/40001/container/lxc/lxc_test.go#...
container/lxc/lxc_test.go:346: s.autoRestartFalse = true
Don't set here and reset at the end, as an assert stops the end from happening.
Instead use PatchValue...

  s.PatchValue(&s.autoRestartFalse, true)

https://codereview.appspot.com/73390043/diff/40001/container/lxc/lxc_test.go#...
container/lxc/lxc_test.go:355: s.autoRestartFalse = true
ditto.

https://codereview.appspot.com/73390043/diff/40001/provider/local/config.go
File provider/local/config.go (right):

https://codereview.appspot.com/73390043/diff/40001/provider/local/config.go#n...
provider/local/config.go:121: value, _ := c.attrs["lxc-auto-restart"].(bool)
I think we want a general auto-restart, not just an lxc- one. We can do the same
for kvm.  Which leads me to point out that you need to fix kvm.

Although I don't think we should add the ability to set it in the local provider
until suspend and resume are done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b