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:
		| @@ -17,7 +17,7 @@ | ||||
| package config | ||||
|  | ||||
| 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"` | ||||
| 	Server         string `yaml:"server"          env:"SERVER"` | ||||
| } | ||||
|   | ||||
| @@ -126,7 +126,7 @@ func (uc Update) Units() []Unit { | ||||
| 			Runtime: true, | ||||
| 		}} | ||||
|  | ||||
| 		if uc.Update.RebootStrategy == "false" || uc.Update.RebootStrategy == "off" { | ||||
| 		if uc.Update.RebootStrategy == "off" { | ||||
| 			ls.Command = "stop" | ||||
| 			ls.Mask = true | ||||
| 		} | ||||
|   | ||||
| @@ -71,15 +71,6 @@ func TestUpdateUnits(t *testing.T) { | ||||
| 				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"}, | ||||
| 			units: []Unit{{config.Unit{ | ||||
| @@ -109,7 +100,7 @@ func TestUpdateFile(t *testing.T) { | ||||
| 		}, | ||||
| 		{ | ||||
| 			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"}, | ||||
| @@ -143,14 +134,6 @@ func TestUpdateFile(t *testing.T) { | ||||
| 				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"}, | ||||
| 			file: &File{config.File{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user