本文整理汇总了Golang中models.InstallerArguments类的典型用法代码示例。如果您正苦于以下问题:Golang InstallerArguments类的具体用法?Golang InstallerArguments怎么用?Golang InstallerArguments使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InstallerArguments类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: fillSyslog
func fillSyslog(args *models.InstallerArguments, manifest models.Manifest) {
repJob := firstRepJob(manifest)
properties := repJob.Properties
// TODO: this is broken on ops manager:
// 1. there are no global properties section
// 2. none of the diego jobs (including rep) has syslog_daemon_config
if properties.Syslog == nil && manifest.Properties != nil {
properties = manifest.Properties
}
if properties.Syslog == nil {
return
}
args.SyslogHostIP = properties.Syslog.Address
args.SyslogPort = properties.Syslog.Port
}
示例2: fillSharedSecret
func fillSharedSecret(args *models.InstallerArguments, manifest models.Manifest) {
repJob := firstRepJob(manifest)
properties := repJob.Properties
if properties.MetronEndpoint == nil {
properties = manifest.Properties
}
args.SharedSecret = properties.MetronEndpoint.SharedSecret
}
示例3: fillEtcdCluster
func fillEtcdCluster(args *models.InstallerArguments, manifest models.Manifest) {
repJob := firstRepJob(manifest)
properties := repJob.Properties
if properties.Loggregator == nil {
properties = manifest.Properties
}
args.EtcdCluster = properties.Loggregator.Etcd.Machines[0]
}
示例4: fillExternalIp
func fillExternalIp(args *models.InstallerArguments, manifest models.Manifest, externalIp string) {
if externalIp == "" {
consulIp := strings.Split(args.ConsulIPs, ",")[0]
conn, err := net.Dial("udp", consulIp+":65530")
FailOnError(err)
externalIp = strings.Split(conn.LocalAddr().String(), ":")[0]
}
args.ExternalIp = externalIp
}
示例5: generateInstallScript
func generateInstallScript(outputDir string, args *models.InstallerArguments) {
content := strings.Replace(installBatTemplate, "\n", "\r\n", -1)
temp := template.Must(template.New("").Parse(content))
args.Zone = "windows"
filename := "install.bat"
file, err := os.OpenFile(path.Join(outputDir, filename), os.O_TRUNC|os.O_CREATE|os.O_RDWR, 0644)
Fatal(err)
defer file.Close()
err = temp.Execute(file, args)
Fatal(err)
}
示例6: fillConsul
func fillConsul(args *models.InstallerArguments, manifest models.Manifest, outputDir string) {
repJob := firstRepJob(manifest)
properties := repJob.Properties
if properties.Consul == nil {
properties = manifest.Properties
}
// missing requireSSL implies true
requireSSL := properties.Consul.RequireSSL
if requireSSL == nil || *requireSSL {
args.ConsulRequireSSL = true
extractConsulKeyAndCert(properties, outputDir)
}
consuls := properties.Consul.Agent.Servers.Lan
if len(consuls) == 0 {
fmt.Fprintf(os.Stderr, "Could not find any Consul VMs in your BOSH deployment")
os.Exit(1)
}
args.ConsulIPs = strings.Join(consuls, ",")
}
示例7: fillBBS
func fillBBS(args *models.InstallerArguments, manifest models.Manifest, outputDir string) {
repJob := firstRepJob(manifest)
properties := repJob.Properties
if properties.Diego.Rep.BBS == nil {
properties = manifest.Properties
}
requireSSL := properties.Diego.Rep.BBS.RequireSSL
// missing requireSSL implies true
if requireSSL == nil || *requireSSL {
args.BbsRequireSsl = true
extractBbsKeyAndCert(properties, outputDir)
}
}
示例8: fillMetronAgent
func fillMetronAgent(args *models.InstallerArguments, manifest models.Manifest, outputDir string) {
repJob := firstRepJob(manifest)
properties := repJob.Properties
if properties.MetronAgent == nil || properties.MetronAgent.PreferredProtocol == nil {
properties = manifest.Properties
}
if properties != nil && properties.MetronAgent != nil && properties.MetronAgent.PreferredProtocol != nil {
if *properties.MetronAgent.PreferredProtocol == "tls" {
args.MetronPreferTLS = true
extractMetronKeyAndCert(properties, outputDir)
}
}
}