reboot-strategy: remove the 'false' value

Since we no longer do a two-stage unmarshal, the 'false' value will no
longer be necessary.
This commit is contained in:
Alex Crawford 2014-12-20 18:04:45 -08:00
parent 248536a5cd
commit 40d943fb7a
3 changed files with 3 additions and 20 deletions

View File

@ -17,7 +17,7 @@
package config package config
type Update struct { type Update struct {
RebootStrategy string `yaml:"reboot_strategy" env:"REBOOT_STRATEGY" valid:"best-effort,etcd-lock,reboot,off,false"` RebootStrategy string `yaml:"reboot_strategy" env:"REBOOT_STRATEGY" valid:"best-effort,etcd-lock,reboot,off"`
Group string `yaml:"group" env:"GROUP"` Group string `yaml:"group" env:"GROUP"`
Server string `yaml:"server" env:"SERVER"` Server string `yaml:"server" env:"SERVER"`
} }

View File

@ -126,7 +126,7 @@ func (uc Update) Units() []Unit {
Runtime: true, Runtime: true,
}} }}
if uc.Update.RebootStrategy == "false" || uc.Update.RebootStrategy == "off" { if uc.Update.RebootStrategy == "off" {
ls.Command = "stop" ls.Command = "stop"
ls.Mask = true ls.Mask = true
} }

View File

@ -71,15 +71,6 @@ func TestUpdateUnits(t *testing.T) {
Runtime: true, Runtime: true,
}}}, }}},
}, },
{
config: config.Update{RebootStrategy: "false"},
units: []Unit{{config.Unit{
Name: "locksmithd.service",
Command: "stop",
Runtime: true,
Mask: true,
}}},
},
{ {
config: config.Update{RebootStrategy: "off"}, config: config.Update{RebootStrategy: "off"},
units: []Unit{{config.Unit{ units: []Unit{{config.Unit{
@ -109,7 +100,7 @@ func TestUpdateFile(t *testing.T) {
}, },
{ {
config: config.Update{RebootStrategy: "wizzlewazzle"}, config: config.Update{RebootStrategy: "wizzlewazzle"},
err: &config.ErrorValid{Value: "wizzlewazzle", Field: "RebootStrategy", Valid: []string{"best-effort", "etcd-lock", "reboot", "off", "false"}}, err: &config.ErrorValid{Value: "wizzlewazzle", Field: "RebootStrategy", Valid: []string{"best-effort", "etcd-lock", "reboot", "off"}},
}, },
{ {
config: config.Update{Group: "master", Server: "http://foo.com"}, config: config.Update{Group: "master", Server: "http://foo.com"},
@ -143,14 +134,6 @@ func TestUpdateFile(t *testing.T) {
RawFilePermissions: "0644", RawFilePermissions: "0644",
}}, }},
}, },
{
config: config.Update{RebootStrategy: "false"},
file: &File{config.File{
Content: "REBOOT_STRATEGY=false\n",
Path: "etc/coreos/update.conf",
RawFilePermissions: "0644",
}},
},
{ {
config: config.Update{RebootStrategy: "off"}, config: config.Update{RebootStrategy: "off"},
file: &File{config.File{ file: &File{config.File{