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
3ee3cf65
Commit
3ee3cf65
authored
Dec 13, 2017
by
zhengjiajin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enhance kube-schedule init flag
parent
38e33513
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
12 deletions
+3
-12
server.go
plugin/cmd/kube-scheduler/app/server.go
+3
-2
scheduler.go
plugin/cmd/kube-scheduler/scheduler.go
+0
-10
No files found.
plugin/cmd/kube-scheduler/app/server.go
View file @
3ee3cf65
...
@@ -70,6 +70,7 @@ import (
...
@@ -70,6 +70,7 @@ import (
"github.com/golang/glog"
"github.com/golang/glog"
"github.com/spf13/cobra"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/pflag"
utilflag
"k8s.io/apiserver/pkg/util/flag"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus"
)
)
...
@@ -342,8 +343,8 @@ through the API as necessary.`,
...
@@ -342,8 +343,8 @@ through the API as necessary.`,
glog
.
Fatalf
(
"unable to apply config defaults: %v"
,
err
)
glog
.
Fatalf
(
"unable to apply config defaults: %v"
,
err
)
}
}
flags
:=
cmd
.
Flags
(
)
AddFlags
(
opts
,
pflag
.
CommandLine
)
AddFlags
(
opts
,
flags
)
utilflag
.
InitFlags
(
)
cmd
.
MarkFlagFilename
(
"config"
,
"yaml"
,
"yml"
,
"json"
)
cmd
.
MarkFlagFilename
(
"config"
,
"yaml"
,
"yml"
,
"json"
)
...
...
plugin/cmd/kube-scheduler/scheduler.go
View file @
3ee3cf65
...
@@ -17,12 +17,8 @@ limitations under the License.
...
@@ -17,12 +17,8 @@ limitations under the License.
package
main
package
main
import
(
import
(
goflag
"flag"
"os"
"os"
"github.com/spf13/pflag"
utilflag
"k8s.io/apiserver/pkg/util/flag"
"k8s.io/apiserver/pkg/util/logs"
"k8s.io/apiserver/pkg/util/logs"
_
"k8s.io/kubernetes/pkg/client/metrics/prometheus"
// for client metric registration
_
"k8s.io/kubernetes/pkg/client/metrics/prometheus"
// for client metric registration
_
"k8s.io/kubernetes/pkg/version/prometheus"
// for version metric registration
_
"k8s.io/kubernetes/pkg/version/prometheus"
// for version metric registration
...
@@ -32,12 +28,6 @@ import (
...
@@ -32,12 +28,6 @@ import (
func
main
()
{
func
main
()
{
command
:=
app
.
NewSchedulerCommand
()
command
:=
app
.
NewSchedulerCommand
()
// TODO: once we switch everything over to Cobra commands, we can go back to calling
// utilflag.InitFlags() (by removing its pflag.Parse() call). For now, we have to set the
// normalize func and add the go flag set by hand.
pflag
.
CommandLine
.
SetNormalizeFunc
(
utilflag
.
WordSepNormalizeFunc
)
pflag
.
CommandLine
.
AddGoFlagSet
(
goflag
.
CommandLine
)
// utilflag.InitFlags()
logs
.
InitLogs
()
logs
.
InitLogs
()
defer
logs
.
FlushLogs
()
defer
logs
.
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