diff --git a/cmd/controller-manager/controller-manager.go b/cmd/controller-manager/controller-manager.go index 20f7a69a35..787c5e0053 100644 --- a/cmd/controller-manager/controller-manager.go +++ b/cmd/controller-manager/controller-manager.go @@ -33,8 +33,8 @@ import ( ) var ( - etcd_servers = flag.String("etcd_servers", "", "Servers for the etcd (http://ip:port).") - master = flag.String("master", "", "The address of the Kubernetes API server") + etcdServers = flag.String("etcd_servers", "", "Servers for the etcd (http://ip:port).") + master = flag.String("master", "", "The address of the Kubernetes API server") ) func main() { @@ -42,7 +42,7 @@ func main() { util.InitLogs() defer util.FlushLogs() - if len(*etcd_servers) == 0 || len(*master) == 0 { + if len(*etcdServers) == 0 || len(*master) == 0 { glog.Fatal("usage: controller-manager -etcd_servers -master ") } @@ -50,7 +50,7 @@ func main() { etcd.SetLogger(util.NewLogger("etcd ")) controllerManager := controller.MakeReplicationManager( - etcd.NewClient([]string{*etcd_servers}), + etcd.NewClient([]string{*etcdServers}), client.New("http://"+*master, nil)) controllerManager.Run(10 * time.Second) diff --git a/cmd/integration/integration.go b/cmd/integration/integration.go index 2f46f91a19..50f55df451 100644 --- a/cmd/integration/integration.go +++ b/cmd/integration/integration.go @@ -76,10 +76,10 @@ func startComponents(manifestURL string) (apiServerURL string) { m := master.New(servers, machineList, fakePodInfoGetter{}, nil, "") apiserver := httptest.NewServer(m.ConstructHandler("/api/v1beta1")) - kClient := client.New(apiserver.URL, nil) - kClient.PollPeriod = time.Second * 1 - kClient.Sync = true - controllerManager := controller.MakeReplicationManager(etcd.NewClient(servers), kClient) + cl := client.New(apiserver.URL, nil) + cl.PollPeriod = time.Second * 1 + cl.Sync = true + controllerManager := controller.MakeReplicationManager(etcd.NewClient(servers), cl) controllerManager.Run(1 * time.Second) @@ -268,7 +268,7 @@ func main() { glog.Infof("OK - found created pods: %#v", createdPods.List()) } -// Serve a file for kubelet to read. +// ServeCachedManifestFile serves a file for kubelet to read. func ServeCachedManifestFile() (servingAddress string) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/manifest" { diff --git a/cmd/kubecfg/kubecfg.go b/cmd/kubecfg/kubecfg.go index ae13408b39..a26c788c55 100644 --- a/cmd/kubecfg/kubecfg.go +++ b/cmd/kubecfg/kubecfg.go @@ -32,7 +32,8 @@ import ( "github.com/golang/glog" ) -const APP_VERSION = "0.1" +// AppVersion is the current version of kubecfg. +const AppVersion = "0.1" // The flag package provides a default help printer via -h switch var ( @@ -97,7 +98,7 @@ func main() { defer util.FlushLogs() if *versionFlag { - fmt.Println("Version:", APP_VERSION) + fmt.Println("Version:", AppVersion) os.Exit(0) } @@ -110,11 +111,11 @@ func main() { } else { masterServer = "http://localhost:8080" } - parsedUrl, err := url.Parse(masterServer) + parsedURL, err := url.Parse(masterServer) if err != nil { glog.Fatalf("Unable to parse %v as a URL\n", err) } - if parsedUrl.Scheme != "" && parsedUrl.Scheme != "https" { + if parsedURL.Scheme != "" && parsedURL.Scheme != "https" { secure = false } diff --git a/cmd/kubelet/kubelet.go b/cmd/kubelet/kubelet.go index 865ea19ef1..866f7eae74 100644 --- a/cmd/kubelet/kubelet.go +++ b/cmd/kubelet/kubelet.go @@ -40,7 +40,7 @@ var ( syncFrequency = flag.Duration("sync_frequency", 10*time.Second, "Max period between synchronizing running containers and config") fileCheckFrequency = flag.Duration("file_check_frequency", 20*time.Second, "Duration between checking config files for new data") httpCheckFrequency = flag.Duration("http_check_frequency", 20*time.Second, "Duration between checking http for new data") - manifestUrl = flag.String("manifest_url", "", "URL for accessing the container manifest") + manifestURL = flag.String("manifest_url", "", "URL for accessing the container manifest") address = flag.String("address", "127.0.0.1", "The address for the info server to serve on") port = flag.Uint("port", 10250, "The port for the info server to serve on") hostnameOverride = flag.String("hostname_override", "", "If non-empty, will use this string as identification instead of the actual hostname.") @@ -82,12 +82,12 @@ func main() { } } - my_kubelet := kubelet.Kubelet{ + k := kubelet.Kubelet{ Hostname: string(hostname), DockerClient: dockerClient, FileCheckFrequency: *fileCheckFrequency, SyncFrequency: *syncFrequency, HTTPCheckFrequency: *httpCheckFrequency, } - my_kubelet.RunKubelet(*dockerEndpoint, *config, *manifestUrl, *etcdServers, *address, *port) + k.RunKubelet(*dockerEndpoint, *config, *manifestURL, *etcdServers, *address, *port) } diff --git a/cmd/proxy/proxy.go b/cmd/proxy/proxy.go index 722e259724..b38f16bf36 100644 --- a/cmd/proxy/proxy.go +++ b/cmd/proxy/proxy.go @@ -27,8 +27,8 @@ import ( ) var ( - config_file = flag.String("configfile", "/tmp/proxy_config", "Configuration file for the proxy") - etcd_servers = flag.String("etcd_servers", "http://10.240.10.57:4001", "Servers for the etcd cluster (http://ip:port).") + configFile = flag.String("configfile", "/tmp/proxy_config", "Configuration file for the proxy") + etcdServers = flag.String("etcd_servers", "http://10.240.10.57:4001", "Servers for the etcd cluster (http://ip:port).") ) func main() { @@ -39,18 +39,18 @@ func main() { // Set up logger for etcd client etcd.SetLogger(util.NewLogger("etcd ")) - glog.Infof("Using configuration file %s and etcd_servers %s", *config_file, *etcd_servers) + glog.Infof("Using configuration file %s and etcd_servers %s", *configFile, *etcdServers) proxyConfig := config.NewServiceConfig() // Create a configuration source that handles configuration from etcd. - etcdClient := etcd.NewClient([]string{*etcd_servers}) + etcdClient := etcd.NewClient([]string{*etcdServers}) config.NewConfigSourceEtcd(etcdClient, proxyConfig.GetServiceConfigurationChannel("etcd"), proxyConfig.GetEndpointsConfigurationChannel("etcd")) // And create a configuration source that reads from a local file - config.NewConfigSourceFile(*config_file, + config.NewConfigSourceFile(*configFile, proxyConfig.GetServiceConfigurationChannel("file"), proxyConfig.GetEndpointsConfigurationChannel("file"))