-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vacant2333 <[email protected]>
- Loading branch information
1 parent
ae0aaac
commit 1a1b96e
Showing
8 changed files
with
147 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,18 +20,13 @@ import ( | |
"fmt" | ||
"os" | ||
"runtime" | ||
"sort" | ||
"time" | ||
|
||
"github.com/spf13/pflag" | ||
utilfeature "k8s.io/apiserver/pkg/util/feature" | ||
cliflag "k8s.io/component-base/cli/flag" | ||
componentbaseoptions "k8s.io/component-base/config/options" | ||
"k8s.io/klog/v2" | ||
"volcano.sh/volcano/cmd/controller-manager/app" | ||
"volcano.sh/volcano/cmd/controller-manager/app/options" | ||
"volcano.sh/volcano/pkg/controllers/framework" | ||
commonutil "volcano.sh/volcano/pkg/util" | ||
"volcano.sh/volcano/pkg/version" | ||
|
||
_ "volcano.sh/volcano/pkg/controllers/garbagecollector" | ||
|
@@ -52,22 +47,25 @@ func main() { | |
fs := pflag.CommandLine | ||
s := options.NewServerOption() | ||
|
||
var knownControllers = func() []string { | ||
var controllerNames []string | ||
fn := func(controller framework.Controller) { | ||
controllerNames = append(controllerNames, controller.Name()) | ||
} | ||
framework.ForeachController(fn) | ||
sort.Strings(controllerNames) | ||
return controllerNames | ||
} | ||
|
||
s.AddFlags(fs, knownControllers()) | ||
utilfeature.DefaultMutableFeatureGate.AddFlag(fs) | ||
|
||
commonutil.LeaderElectionDefault(&s.LeaderElection) | ||
s.LeaderElection.ResourceName = componentName | ||
componentbaseoptions.BindLeaderElectionFlags(&s.LeaderElection, fs) | ||
//var knownControllers = func() []string { | ||
// var controllerNames []string | ||
// fn := func(controller framework.Controller) { | ||
// controllerNames = append(controllerNames, controller.Name()) | ||
// } | ||
// framework.ForeachController(fn) | ||
// sort.Strings(controllerNames) | ||
// return controllerNames | ||
//} | ||
|
||
s.AddFlags(fs) | ||
|
||
// todo: enable this when update [email protected] | ||
//s.AddFlags(fs, knownControllers()) | ||
//utilfeature.DefaultMutableFeatureGate.AddFlag(fs) | ||
// | ||
//commonutil.LeaderElectionDefault(&s.LeaderElection) | ||
//s.LeaderElection.ResourceName = componentName | ||
//componentbaseoptions.BindLeaderElectionFlags(&s.LeaderElection, fs) | ||
|
||
cliflag.InitFlags() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.