Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
6bd6b905
Commit
6bd6b905
authored
Jan 14, 2015
by
Joe Beda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address code review comments
Add some documentation. Create new util.InitFlags() function to merge and parse in one step.
parent
1d0b6ee5
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
36 additions
and
17 deletions
+36
-17
e2e.go
cmd/e2e/e2e.go
+1
-2
integration.go
cmd/integration/integration.go
+1
-3
apiserver.go
cmd/kube-apiserver/apiserver.go
+1
-2
controller-manager.go
cmd/kube-controller-manager/controller-manager.go
+1
-2
proxy.go
cmd/kube-proxy/proxy.go
+1
-2
kubelet.go
cmd/kubelet/kubelet.go
+1
-2
kubernetes.go
cmd/kubernetes/kubernetes.go
+1
-2
flags.go
pkg/util/flags.go
+27
-0
verflag.go
pkg/version/verflag/verflag.go
+1
-0
scheduler.go
plugin/cmd/kube-scheduler/scheduler.go
+1
-2
No files found.
cmd/e2e/e2e.go
View file @
6bd6b905
...
@@ -700,8 +700,7 @@ func TestPodHasServiceEnvVars(c *client.Client) bool {
...
@@ -700,8 +700,7 @@ func TestPodHasServiceEnvVars(c *client.Client) bool {
}
}
func
main
()
{
func
main
()
{
util
.
AddAllFlagsToPFlags
()
util
.
InitFlags
()
flag
.
Parse
()
goruntime
.
GOMAXPROCS
(
goruntime
.
NumCPU
())
goruntime
.
GOMAXPROCS
(
goruntime
.
NumCPU
())
util
.
ReallyCrash
=
true
util
.
ReallyCrash
=
true
util
.
InitLogs
()
util
.
InitLogs
()
...
...
cmd/integration/integration.go
View file @
6bd6b905
...
@@ -53,7 +53,6 @@ import (
...
@@ -53,7 +53,6 @@ import (
"github.com/coreos/go-etcd/etcd"
"github.com/coreos/go-etcd/etcd"
"github.com/golang/glog"
"github.com/golang/glog"
flag
"github.com/spf13/pflag"
)
)
var
(
var
(
...
@@ -563,8 +562,7 @@ func runServiceTest(client *client.Client) {
...
@@ -563,8 +562,7 @@ func runServiceTest(client *client.Client) {
type
testFunc
func
(
*
client
.
Client
)
type
testFunc
func
(
*
client
.
Client
)
func
main
()
{
func
main
()
{
util
.
AddAllFlagsToPFlags
()
util
.
InitFlags
()
flag
.
Parse
()
runtime
.
GOMAXPROCS
(
runtime
.
NumCPU
())
runtime
.
GOMAXPROCS
(
runtime
.
NumCPU
())
util
.
ReallyCrash
=
true
util
.
ReallyCrash
=
true
util
.
InitLogs
()
util
.
InitLogs
()
...
...
cmd/kube-apiserver/apiserver.go
View file @
6bd6b905
...
@@ -124,8 +124,7 @@ func newEtcd(etcdConfigFile string, etcdServerList util.StringList) (helper tool
...
@@ -124,8 +124,7 @@ func newEtcd(etcdConfigFile string, etcdServerList util.StringList) (helper tool
}
}
func
main
()
{
func
main
()
{
util
.
AddAllFlagsToPFlags
()
util
.
InitFlags
()
flag
.
Parse
()
util
.
InitLogs
()
util
.
InitLogs
()
defer
util
.
FlushLogs
()
defer
util
.
FlushLogs
()
...
...
cmd/kube-controller-manager/controller-manager.go
View file @
6bd6b905
...
@@ -75,8 +75,7 @@ func verifyMinionFlags() {
...
@@ -75,8 +75,7 @@ func verifyMinionFlags() {
}
}
func
main
()
{
func
main
()
{
util
.
AddAllFlagsToPFlags
()
util
.
InitFlags
()
flag
.
Parse
()
util
.
InitLogs
()
util
.
InitLogs
()
defer
util
.
FlushLogs
()
defer
util
.
FlushLogs
()
...
...
cmd/kube-proxy/proxy.go
View file @
6bd6b905
...
@@ -53,8 +53,7 @@ func init() {
...
@@ -53,8 +53,7 @@ func init() {
}
}
func
main
()
{
func
main
()
{
util
.
AddAllFlagsToPFlags
()
util
.
InitFlags
()
flag
.
Parse
()
util
.
InitLogs
()
util
.
InitLogs
()
defer
util
.
FlushLogs
()
defer
util
.
FlushLogs
()
...
...
cmd/kubelet/kubelet.go
View file @
6bd6b905
...
@@ -90,8 +90,7 @@ func setupRunOnce() {
...
@@ -90,8 +90,7 @@ func setupRunOnce() {
}
}
func
main
()
{
func
main
()
{
util
.
AddAllFlagsToPFlags
()
util
.
InitFlags
()
flag
.
Parse
()
util
.
InitLogs
()
util
.
InitLogs
()
defer
util
.
FlushLogs
()
defer
util
.
FlushLogs
()
rand
.
Seed
(
time
.
Now
()
.
UTC
()
.
UnixNano
())
rand
.
Seed
(
time
.
Now
()
.
UTC
()
.
UnixNano
())
...
...
cmd/kubernetes/kubernetes.go
View file @
6bd6b905
...
@@ -66,8 +66,7 @@ func newApiClient(addr string, port int) *client.Client {
...
@@ -66,8 +66,7 @@ func newApiClient(addr string, port int) *client.Client {
}
}
func
main
()
{
func
main
()
{
util
.
AddAllFlagsToPFlags
()
util
.
InitFlags
()
flag
.
Parse
()
util
.
InitLogs
()
util
.
InitLogs
()
defer
util
.
FlushLogs
()
defer
util
.
FlushLogs
()
...
...
pkg/util/flags.go
0 → 100644
View file @
6bd6b905
/*
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
util
import
(
flag
"github.com/spf13/pflag"
)
// InitFlags normalizes and parses the command line flags
func
InitFlags
()
{
AddAllFlagsToPFlags
()
flag
.
Parse
()
}
pkg/version/verflag/verflag.go
View file @
6bd6b905
...
@@ -66,6 +66,7 @@ func (v *versionValue) String() string {
...
@@ -66,6 +66,7 @@ func (v *versionValue) String() string {
return
fmt
.
Sprintf
(
"%v"
,
bool
(
*
v
==
VersionTrue
))
return
fmt
.
Sprintf
(
"%v"
,
bool
(
*
v
==
VersionTrue
))
}
}
// The type of the flag as requred by the pflag.Value interface
func
(
v
*
versionValue
)
Type
()
string
{
func
(
v
*
versionValue
)
Type
()
string
{
return
"version"
return
"version"
}
}
...
...
plugin/cmd/kube-scheduler/scheduler.go
View file @
6bd6b905
...
@@ -48,8 +48,7 @@ func init() {
...
@@ -48,8 +48,7 @@ func init() {
}
}
func
main
()
{
func
main
()
{
util
.
AddAllFlagsToPFlags
()
util
.
InitFlags
()
flag
.
Parse
()
util
.
InitLogs
()
util
.
InitLogs
()
defer
util
.
FlushLogs
()
defer
util
.
FlushLogs
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment