提交 37fd0f0a 编写于 作者: M Matt Rickard 提交者: GitHub

Merge pull request #900 from r2d4/iso-config

Make iso-url configurable through config command
......@@ -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,
......
......@@ -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 {
......
......@@ -17,6 +17,7 @@ Configurable fields:
* show-libmachine-logs
* log_dir
* kubernetes-version
* iso-url
* WantUpdateNotification
* ReminderWaitPeriodInHours
* WantReportError
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册