Guard against nil panics
parent
7d7b9d6fb9
commit
2fd7492377
|
@ -155,7 +155,9 @@ func runStart(cmd *cobra.Command, args []string) {
|
|||
exit.WithCodeT(exit.Data, "Unable to load config: {{.error}}", out.V{"error": err})
|
||||
}
|
||||
|
||||
upgradeExistingConfig(existing)
|
||||
if existing != nil {
|
||||
upgradeExistingConfig(existing)
|
||||
}
|
||||
|
||||
validateSpecifiedDriver(existing)
|
||||
validateKubernetesVersion(existing)
|
||||
|
|
|
@ -359,6 +359,10 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k
|
|||
|
||||
// upgradeExistingConfig upgrades legacy configuration files
|
||||
func upgradeExistingConfig(cc *config.ClusterConfig) {
|
||||
if cc == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if cc.VMDriver != "" && cc.Driver == "" {
|
||||
glog.Infof("config upgrade: Driver=%s", cc.VMDriver)
|
||||
cc.Driver = cc.VMDriver
|
||||
|
|
Loading…
Reference in New Issue