mirror of https://github.com/k3s-io/k3s
clean up code comments for the kubecfg command
This patch removes unnecessary code comments and improves the comment for the readConfig function.pull/6/head
parent
1e63719e02
commit
5e8326bd1d
|
@ -36,7 +36,6 @@ import (
|
||||||
// AppVersion is the current version of kubecfg.
|
// AppVersion is the current version of kubecfg.
|
||||||
const AppVersion = "0.1"
|
const AppVersion = "0.1"
|
||||||
|
|
||||||
// The flag package provides a default help printer via -h switch
|
|
||||||
var (
|
var (
|
||||||
versionFlag = flag.Bool("V", false, "Print the version number.")
|
versionFlag = flag.Bool("V", false, "Print the version number.")
|
||||||
httpServer = flag.String("h", "", "The host to connect to.")
|
httpServer = flag.String("h", "", "The host to connect to.")
|
||||||
|
@ -71,7 +70,8 @@ func usage() {
|
||||||
flag.PrintDefaults()
|
flag.PrintDefaults()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reads & parses config file. On error, calls glog.Fatal().
|
// readConfig reads and parses pod, replicationController, and service
|
||||||
|
// configuration files. If any errors log and exit non-zero.
|
||||||
func readConfig(storage string) []byte {
|
func readConfig(storage string) []byte {
|
||||||
if len(*config) == 0 {
|
if len(*config) == 0 {
|
||||||
glog.Fatal("Need config file (-c)")
|
glog.Fatal("Need config file (-c)")
|
||||||
|
@ -90,13 +90,12 @@ func readConfig(storage string) []byte {
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
// CloudCfg command line tool.
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Usage = func() {
|
flag.Usage = func() {
|
||||||
usage()
|
usage()
|
||||||
}
|
}
|
||||||
|
|
||||||
flag.Parse() // Scan the arguments list
|
flag.Parse()
|
||||||
util.InitLogs()
|
util.InitLogs()
|
||||||
defer util.FlushLogs()
|
defer util.FlushLogs()
|
||||||
|
|
||||||
|
@ -150,7 +149,6 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attempts to execute an API request
|
|
||||||
func executeAPIRequest(method string, s *kube_client.Client) bool {
|
func executeAPIRequest(method string, s *kube_client.Client) bool {
|
||||||
parseStorage := func() string {
|
parseStorage := func() string {
|
||||||
if len(flag.Args()) != 2 {
|
if len(flag.Args()) != 2 {
|
||||||
|
@ -225,7 +223,6 @@ func executeAPIRequest(method string, s *kube_client.Client) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attempts to execute a replicationController request
|
|
||||||
func executeControllerRequest(method string, c *kube_client.Client) bool {
|
func executeControllerRequest(method string, c *kube_client.Client) bool {
|
||||||
parseController := func() string {
|
parseController := func() string {
|
||||||
if len(flag.Args()) != 2 {
|
if len(flag.Args()) != 2 {
|
||||||
|
|
Loading…
Reference in New Issue