Merge pull request #3480 from jbeda/all_pflag

Convert all main binaries to pflag library
This commit is contained in:
Joe Beda
2015-01-15 11:26:41 -08:00
46 changed files with 335 additions and 272 deletions

View File

@@ -17,7 +17,6 @@ limitations under the License.
package main
import (
"flag"
"fmt"
"io/ioutil"
"os"
@@ -35,6 +34,8 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/golang/glog"
flag "github.com/spf13/pflag"
)
var (
@@ -699,7 +700,7 @@ func TestPodHasServiceEnvVars(c *client.Client) bool {
}
func main() {
flag.Parse()
util.InitFlags()
goruntime.GOMAXPROCS(goruntime.NumCPU())
util.ReallyCrash = true
util.InitLogs()

View File

@@ -19,7 +19,6 @@ limitations under the License.
package main
import (
"flag"
"io/ioutil"
"net"
"net/http"
@@ -563,7 +562,7 @@ func runServiceTest(client *client.Client) {
type testFunc func(*client.Client)
func main() {
flag.Parse()
util.InitFlags()
runtime.GOMAXPROCS(runtime.NumCPU())
util.ReallyCrash = true
util.InitLogs()

View File

@@ -20,7 +20,6 @@ package main
import (
"crypto/tls"
"flag"
"net"
"net/http"
"strconv"
@@ -40,6 +39,7 @@ import (
"github.com/coreos/go-etcd/etcd"
"github.com/golang/glog"
flag "github.com/spf13/pflag"
)
var (
@@ -124,7 +124,7 @@ func newEtcd(etcdConfigFile string, etcdServerList util.StringList) (helper tool
}
func main() {
flag.Parse()
util.InitFlags()
util.InitLogs()
defer util.FlushLogs()

View File

@@ -21,7 +21,6 @@ limitations under the License.
package main
import (
"flag"
"net"
"net/http"
"strconv"
@@ -38,7 +37,9 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/service"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
"github.com/golang/glog"
flag "github.com/spf13/pflag"
)
var (
@@ -74,7 +75,7 @@ func verifyMinionFlags() {
}
func main() {
flag.Parse()
util.InitFlags()
util.InitLogs()
defer util.FlushLogs()

View File

@@ -17,7 +17,6 @@ limitations under the License.
package main
import (
"flag"
"net"
"net/http"
"strconv"
@@ -32,8 +31,10 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/exec"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/iptables"
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
"github.com/coreos/go-etcd/etcd"
"github.com/golang/glog"
flag "github.com/spf13/pflag"
)
var (
@@ -52,7 +53,7 @@ func init() {
}
func main() {
flag.Parse()
util.InitFlags()
util.InitLogs()
defer util.FlushLogs()

View File

@@ -37,6 +37,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/version"
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
"github.com/golang/glog"
"github.com/skratchdot/open-golang/open"
)

View File

@@ -21,7 +21,6 @@ limitations under the License.
package main
import (
"flag"
"math/rand"
"net"
"time"
@@ -33,7 +32,9 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/standalone"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
"github.com/golang/glog"
flag "github.com/spf13/pflag"
)
const defaultRootDir = "/var/lib/kubelet"
@@ -89,7 +90,7 @@ func setupRunOnce() {
}
func main() {
flag.Parse()
util.InitFlags()
util.InitLogs()
defer util.FlushLogs()
rand.Seed(time.Now().UTC().UnixNano())

View File

@@ -21,7 +21,6 @@ limitations under the License.
package main
import (
"flag"
"fmt"
"time"
@@ -33,6 +32,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/golang/glog"
flag "github.com/spf13/pflag"
)
var (
@@ -66,7 +66,7 @@ func newApiClient(addr string, port int) *client.Client {
}
func main() {
flag.Parse()
util.InitFlags()
util.InitLogs()
defer util.FlushLogs()