本文整理汇总了Golang中github.com/openshift/origin/pkg/cmd/server/start.AllInOneOptions类的典型用法代码示例。如果您正苦于以下问题:Golang AllInOneOptions类的具体用法?Golang AllInOneOptions怎么用?Golang AllInOneOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AllInOneOptions类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: DefaultAllInOneOptions
func DefaultAllInOneOptions() (*configapi.MasterConfig, *configapi.NodeConfig, error) {
startOptions := start.AllInOneOptions{MasterOptions: &start.MasterOptions{}, NodeArgs: &start.NodeArgs{}}
startOptions.MasterOptions.MasterArgs, startOptions.NodeArgs, _, _, _ = setupStartOptions()
startOptions.MasterOptions.MasterArgs.NodeList = nil
startOptions.NodeArgs.AllowDisabledDocker = true
startOptions.ServiceNetworkCIDR = start.NewDefaultNetworkArgs().ServiceNetworkCIDR
startOptions.Complete()
startOptions.MasterOptions.MasterArgs.ConfigDir.Default(path.Join(util.GetBaseDir(), "openshift.local.config", "master"))
startOptions.NodeArgs.ConfigDir.Default(path.Join(util.GetBaseDir(), "openshift.local.config", admin.DefaultNodeDir(startOptions.NodeArgs.NodeName)))
startOptions.NodeArgs.MasterCertDir = startOptions.MasterOptions.MasterArgs.ConfigDir.Value()
if err := CreateMasterCerts(startOptions.MasterOptions.MasterArgs); err != nil {
return nil, nil, err
}
if err := CreateBootstrapPolicy(startOptions.MasterOptions.MasterArgs); err != nil {
return nil, nil, err
}
if err := CreateNodeCerts(startOptions.NodeArgs); err != nil {
return nil, nil, err
}
masterOptions, err := startOptions.MasterOptions.MasterArgs.BuildSerializeableMasterConfig()
if err != nil {
return nil, nil, err
}
nodeOptions, err := startOptions.NodeArgs.BuildSerializeableNodeConfig()
if err != nil {
return nil, nil, err
}
return masterOptions, nodeOptions, nil
}
示例2: DefaultAllInOneOptions
func DefaultAllInOneOptions() (*configapi.MasterConfig, *configapi.NodeConfig, *utilflags.ComponentFlag, error) {
startOptions := start.AllInOneOptions{MasterOptions: &start.MasterOptions{}, NodeArgs: &start.NodeArgs{}}
startOptions.MasterOptions.MasterArgs, startOptions.NodeArgs, _, _, _ = setupStartOptions(false, false)
startOptions.NodeArgs.AllowDisabledDocker = true
startOptions.NodeArgs.Components.Disable("plugins", "proxy", "dns")
startOptions.ServiceNetworkCIDR = start.NewDefaultNetworkArgs().ServiceNetworkCIDR
startOptions.Complete()
startOptions.MasterOptions.MasterArgs.ConfigDir.Default(path.Join(util.GetBaseDir(), "openshift.local.config", "master"))
startOptions.NodeArgs.ConfigDir.Default(path.Join(util.GetBaseDir(), "openshift.local.config", admin.DefaultNodeDir(startOptions.NodeArgs.NodeName)))
startOptions.NodeArgs.MasterCertDir = startOptions.MasterOptions.MasterArgs.ConfigDir.Value()
if err := CreateMasterCerts(startOptions.MasterOptions.MasterArgs); err != nil {
return nil, nil, nil, err
}
if err := CreateBootstrapPolicy(startOptions.MasterOptions.MasterArgs); err != nil {
return nil, nil, nil, err
}
if err := CreateNodeCerts(startOptions.NodeArgs, startOptions.MasterOptions.MasterArgs.MasterAddr.String()); err != nil {
return nil, nil, nil, err
}
masterOptions, err := startOptions.MasterOptions.MasterArgs.BuildSerializeableMasterConfig()
if err != nil {
return nil, nil, nil, err
}
if fn := startOptions.MasterOptions.MasterArgs.OverrideConfig; fn != nil {
if err := fn(masterOptions); err != nil {
return nil, nil, nil, err
}
}
nodeOptions, err := startOptions.NodeArgs.BuildSerializeableNodeConfig()
if err != nil {
return nil, nil, nil, err
}
return masterOptions, nodeOptions, startOptions.NodeArgs.Components, nil
}