Make iso-url configurable through config command

pull/900/head
Matt Rickard 2016-12-08 15:06:57 -08:00
parent 9d48843967
commit 6f756a7481
3 changed files with 15 additions and 0 deletions

View File

@ -92,6 +92,11 @@ var settings = []Setting{
name: "kubernetes-version",
set: SetString,
},
{
name: "iso-url",
set: SetString,
validations: []setFn{IsValidURL},
},
{
name: config.WantUpdateNotification,
set: SetBool,

View File

@ -19,6 +19,7 @@ package config
import (
"fmt"
"net"
"net/url"
"os"
"strconv"
@ -50,6 +51,14 @@ func IsValidDiskSize(name string, disksize string) error {
return nil
}
func IsValidURL(name string, location string) error {
_, err := url.Parse(location)
if err != nil {
return fmt.Errorf("%s is not a valid URL", location)
}
return nil
}
func IsPositive(name string, val string) error {
i, err := strconv.Atoi(val)
if err != nil {

View File

@ -17,6 +17,7 @@ Configurable fields:
* show-libmachine-logs
* log_dir
* kubernetes-version
* iso-url
* WantUpdateNotification
* ReminderWaitPeriodInHours
* WantReportError