| ... | ... |
@@ -70,7 +70,6 @@ func NewCommandStartMasterAPI(name, basename string, out io.Writer) (*cobra.Comm |
| 70 | 70 |
// This command only supports reading from config and the listen argument |
| 71 | 71 |
flags.StringVar(&options.ConfigFile, "config", "", "Location of the master configuration file to run from. Required") |
| 72 | 72 |
cmd.MarkFlagFilename("config", "yaml", "yml")
|
| 73 |
- BindListenArg(options.MasterArgs.ListenArg, flags, "") |
|
| 74 | 73 |
|
| 75 | 74 |
return cmd, options |
| 76 | 75 |
} |
| ... | ... |
@@ -277,7 +277,7 @@ func (o MasterOptions) RunMaster() error {
|
| 277 | 277 |
masterConfig.Controllers = configapi.ControllersDisabled |
| 278 | 278 |
} |
| 279 | 279 |
|
| 280 |
- m := &master{
|
|
| 280 |
+ m := &Master{
|
|
| 281 | 281 |
config: masterConfig, |
| 282 | 282 |
api: o.MasterArgs.StartAPI, |
| 283 | 283 |
controllers: o.MasterArgs.StartControllers, |
| ... | ... |
@@ -335,16 +335,25 @@ func buildKubernetesMasterConfig(openshiftConfig *origin.MasterConfig) (*kuberne |
| 335 | 335 |
return kubeConfig, err |
| 336 | 336 |
} |
| 337 | 337 |
|
| 338 |
-// master encapsulates starting the components of the master |
|
| 339 |
-type master struct {
|
|
| 338 |
+// Master encapsulates starting the components of the master |
|
| 339 |
+type Master struct {
|
|
| 340 | 340 |
config *configapi.MasterConfig |
| 341 | 341 |
controllers bool |
| 342 | 342 |
api bool |
| 343 | 343 |
} |
| 344 | 344 |
|
| 345 |
+// NewMaster create a master launcher |
|
| 346 |
+func NewMaster(config *configapi.MasterConfig, controllers, api bool) *Master {
|
|
| 347 |
+ return &Master{
|
|
| 348 |
+ config: config, |
|
| 349 |
+ controllers: controllers, |
|
| 350 |
+ api: api, |
|
| 351 |
+ } |
|
| 352 |
+} |
|
| 353 |
+ |
|
| 345 | 354 |
// Start launches a master. It will error if possible, but some background processes may still |
| 346 | 355 |
// be running and the process should exit after it finishes. |
| 347 |
-func (m *master) Start() error {
|
|
| 356 |
+func (m *Master) Start() error {
|
|
| 348 | 357 |
// Allow privileged containers |
| 349 | 358 |
// TODO: make this configurable and not the default https://github.com/openshift/origin/issues/662 |
| 350 | 359 |
capabilities.Initialize(capabilities.Capabilities{
|
| ... | ... |
@@ -273,7 +273,7 @@ func StartConfiguredMasterWithOptions(masterConfig *configapi.MasterConfig, test |
| 273 | 273 |
DeleteAllEtcdKeys() |
| 274 | 274 |
} |
| 275 | 275 |
|
| 276 |
- if err := start.StartMaster(masterConfig); err != nil {
|
|
| 276 |
+ if err := start.NewMaster(masterConfig, true, true).Start(); err != nil {
|
|
| 277 | 277 |
return "", err |
| 278 | 278 |
} |
| 279 | 279 |
adminKubeConfigFile := KubeConfigPath() |