mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +00:00
Fix golint errors
This commit is contained in:
@@ -11,31 +11,30 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
OEM = "/usr/share/ros/oem"
|
||||
DOCKER_BIN = "/usr/bin/docker"
|
||||
DOCKER_DIST_BIN = "/usr/bin/docker.dist"
|
||||
ROS_BIN = "/usr/bin/ros"
|
||||
SYSINIT_BIN = "/usr/bin/ros-sysinit"
|
||||
DOCKER_SYSTEM_HOME = "/var/lib/system-docker"
|
||||
DOCKER_SYSTEM_HOST = "unix:///var/run/system-docker.sock"
|
||||
DOCKER_HOST = "unix:///var/run/docker.sock"
|
||||
IMAGES_PATH = "/usr/share/ros"
|
||||
IMAGES_PATTERN = "images*.tar"
|
||||
MODULES_ARCHIVE = "/modules.tar"
|
||||
DEBUG = false
|
||||
SYSTEM_DOCKER_LOG = "/var/log/system-docker.log"
|
||||
SYSTEM_DOCKER_BIN = "/usr/bin/system-docker"
|
||||
OEM = "/usr/share/ros/oem"
|
||||
DockerBin = "/usr/bin/docker"
|
||||
DockerDistBin = "/usr/bin/docker.dist"
|
||||
RosBin = "/usr/bin/ros"
|
||||
SysInitBin = "/usr/bin/ros-sysinit"
|
||||
SystemDockerHome = "/var/lib/system-docker"
|
||||
SystemDockerHost = "unix:///var/run/system-docker.sock"
|
||||
DockerHost = "unix:///var/run/docker.sock"
|
||||
ImagesPath = "/usr/share/ros"
|
||||
ImagesPattern = "images*.tar"
|
||||
ModulesArchive = "/modules.tar"
|
||||
Debug = false
|
||||
SystemDockerLog = "/var/log/system-docker.log"
|
||||
SystemDockerBin = "/usr/bin/system-docker"
|
||||
|
||||
LABEL = "label"
|
||||
HASH = "io.rancher.os.hash"
|
||||
ID = "io.rancher.os.id"
|
||||
DETACH = "io.rancher.os.detach"
|
||||
CREATE_ONLY = "io.rancher.os.createonly"
|
||||
RELOAD_CONFIG = "io.rancher.os.reloadconfig"
|
||||
CONSOLE = "io.rancher.os.console"
|
||||
SCOPE = "io.rancher.os.scope"
|
||||
REBUILD = "io.docker.compose.rebuild"
|
||||
SYSTEM = "system"
|
||||
HashLabel = "io.rancher.os.hash"
|
||||
IDLabel = "io.rancher.os.id"
|
||||
DetachLabel = "io.rancher.os.detach"
|
||||
CreateOnlyLabel = "io.rancher.os.createonly"
|
||||
ReloadConfigLabel = "io.rancher.os.reloadconfig"
|
||||
ConsoleLabel = "io.rancher.os.console"
|
||||
ScopeLabel = "io.rancher.os.scope"
|
||||
RebuildLabel = "io.docker.compose.rebuild"
|
||||
System = "system"
|
||||
|
||||
OsConfigFile = "/usr/share/ros/os-config.yml"
|
||||
CloudConfigDir = "/var/lib/rancher/conf/cloud-config.d"
|
||||
@@ -48,11 +47,11 @@ const (
|
||||
|
||||
var (
|
||||
OemConfigFile = OEM + "/oem-config.yml"
|
||||
VERSION string
|
||||
ARCH string
|
||||
SUFFIX string
|
||||
OS_REPO string
|
||||
OS_BASE string
|
||||
Version string
|
||||
Arch string
|
||||
Suffix string
|
||||
OsRepo string
|
||||
OsBase string
|
||||
PrivateKeys = []string{
|
||||
"rancher.ssh",
|
||||
"rancher.docker.ca_key",
|
||||
@@ -63,22 +62,22 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
if VERSION == "" {
|
||||
VERSION = "v0.0.0-dev"
|
||||
if Version == "" {
|
||||
Version = "v0.0.0-dev"
|
||||
}
|
||||
if ARCH == "" {
|
||||
ARCH = runtime.GOARCH
|
||||
if Arch == "" {
|
||||
Arch = runtime.GOARCH
|
||||
}
|
||||
if SUFFIX == "" && ARCH != "amd64" {
|
||||
SUFFIX = "_" + ARCH
|
||||
if Suffix == "" && Arch != "amd64" {
|
||||
Suffix = "_" + Arch
|
||||
}
|
||||
if OS_BASE == "" {
|
||||
OS_BASE = fmt.Sprintf("%s/os-base:%s%s", OS_REPO, VERSION, SUFFIX)
|
||||
if OsBase == "" {
|
||||
OsBase = fmt.Sprintf("%s/os-base:%s%s", OsRepo, Version, Suffix)
|
||||
}
|
||||
}
|
||||
|
||||
type Repository struct {
|
||||
Url string `yaml:"url,omitempty"`
|
||||
URL string `yaml:"url,omitempty"`
|
||||
}
|
||||
|
||||
type Repositories map[string]Repository
|
||||
@@ -117,7 +116,7 @@ type RancherConfig struct {
|
||||
Network NetworkConfig `yaml:"network,omitempty"`
|
||||
DefaultNetwork NetworkConfig `yaml:"default_network,omitempty"`
|
||||
Repositories Repositories `yaml:"repositories,omitempty"`
|
||||
Ssh SshConfig `yaml:"ssh,omitempty"`
|
||||
SSH SSHConfig `yaml:"ssh,omitempty"`
|
||||
State StateConfig `yaml:"state,omitempty"`
|
||||
SystemDocker DockerConfig `yaml:"system_docker,omitempty"`
|
||||
Upgrade UpgradeConfig `yaml:"upgrade,omitempty"`
|
||||
@@ -130,7 +129,7 @@ type RancherConfig struct {
|
||||
}
|
||||
|
||||
type UpgradeConfig struct {
|
||||
Url string `yaml:"url,omitempty"`
|
||||
URL string `yaml:"url,omitempty"`
|
||||
Image string `yaml:"image,omitempty"`
|
||||
Rollback string `yaml:"rollback,omitempty"`
|
||||
}
|
||||
@@ -173,11 +172,11 @@ type DockerConfig struct {
|
||||
|
||||
type NetworkConfig struct {
|
||||
PreCmds []string `yaml:"pre_cmds,omitempty"`
|
||||
Dns DnsConfig `yaml:"dns,omitempty"`
|
||||
DNS DNSConfig `yaml:"dns,omitempty"`
|
||||
Interfaces map[string]InterfaceConfig `yaml:"interfaces,omitempty"`
|
||||
PostCmds []string `yaml:"post_cmds,omitempty"`
|
||||
HttpProxy string `yaml:"http_proxy,omitempty"`
|
||||
HttpsProxy string `yaml:"https_proxy,omitempty"`
|
||||
HTTPProxy string `yaml:"http_proxy,omitempty"`
|
||||
HTTPSProxy string `yaml:"https_proxy,omitempty"`
|
||||
NoProxy string `yaml:"no_proxy,omitempty"`
|
||||
}
|
||||
|
||||
@@ -199,12 +198,12 @@ type InterfaceConfig struct {
|
||||
Vlans string `yaml:"vlans,omitempty"`
|
||||
}
|
||||
|
||||
type DnsConfig struct {
|
||||
type DNSConfig struct {
|
||||
Nameservers []string `yaml:"nameservers,flow,omitempty"`
|
||||
Search []string `yaml:"search,flow,omitempty"`
|
||||
}
|
||||
|
||||
type SshConfig struct {
|
||||
type SSHConfig struct {
|
||||
Keys map[string]string `yaml:"keys,omitempty"`
|
||||
}
|
||||
|
||||
@@ -234,8 +233,8 @@ type Defaults struct {
|
||||
func (r Repositories) ToArray() []string {
|
||||
result := make([]string, 0, len(r))
|
||||
for _, repo := range r {
|
||||
if repo.Url != "" {
|
||||
result = append(result, repo.Url)
|
||||
if repo.URL != "" {
|
||||
result = append(result, repo.URL)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user