本文整理汇总了Golang中github.com/cloudfoundry/bosh-agent/agent/applier/applyspec.ApplySpec类的典型用法代码示例。如果您正苦于以下问题:Golang ApplySpec类的具体用法?Golang ApplySpec怎么用?Golang ApplySpec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ApplySpec类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: setUpLogrotate
func (a *concreteApplier) setUpLogrotate(applySpec as.ApplySpec) error {
err := a.logrotateDelegate.SetupLogrotate(
boshsettings.VCAPUsername,
a.dirProvider.BaseDir(),
applySpec.MaxLogFileSize(),
)
if err != nil {
return bosherr.WrapError(err, "Logrotate setup failed")
}
return nil
}
开发者ID:keaty,项目名称:bosh-provisioner,代码行数:12,代码来源:concrete_applier.go
示例2: Prepare
func (a *concreteApplier) Prepare(desiredApplySpec as.ApplySpec) error {
for _, job := range desiredApplySpec.Jobs() {
err := a.jobApplier.Prepare(job)
if err != nil {
return bosherr.WrapError(err, "Preparing job %s", job.Name)
}
}
for _, pkg := range desiredApplySpec.Packages() {
err := a.packageApplier.Prepare(pkg)
if err != nil {
return bosherr.WrapError(err, "Preparing package %s", pkg.Name)
}
}
return nil
}
开发者ID:keaty,项目名称:bosh-provisioner,代码行数:17,代码来源:concrete_applier.go
示例3: ConfigureJobs
func (a *concreteApplier) ConfigureJobs(desiredApplySpec as.ApplySpec) error {
jobs := desiredApplySpec.Jobs()
for i := 0; i < len(jobs); i++ {
job := jobs[len(jobs)-1-i]
err := a.jobApplier.Configure(job, i)
if err != nil {
return bosherr.WrapErrorf(err, "Configuring job %s", job.Name)
}
}
err := a.jobSupervisor.Reload()
if err != nil {
return bosherr.WrapError(err, "Reloading jobSupervisor")
}
return nil
}
开发者ID:EMC-CMD,项目名称:bosh-agent,代码行数:19,代码来源:concrete_applier.go
示例4: Apply
func (a *concreteApplier) Apply(currentApplySpec, desiredApplySpec as.ApplySpec) error {
err := a.jobSupervisor.RemoveAllJobs()
if err != nil {
return bosherr.WrapError(err, "Removing all jobs")
}
jobs := desiredApplySpec.Jobs()
for _, job := range jobs {
err = a.jobApplier.Apply(job)
if err != nil {
return bosherr.WrapError(err, "Applying job %s", job.Name)
}
}
err = a.jobApplier.KeepOnly(append(currentApplySpec.Jobs(), desiredApplySpec.Jobs()...))
if err != nil {
return bosherr.WrapError(err, "Keeping only needed jobs")
}
for _, pkg := range desiredApplySpec.Packages() {
err = a.packageApplier.Apply(pkg)
if err != nil {
return bosherr.WrapError(err, "Applying package %s", pkg.Name)
}
}
err = a.packageApplier.KeepOnly(append(currentApplySpec.Packages(), desiredApplySpec.Packages()...))
if err != nil {
return bosherr.WrapError(err, "Keeping only needed packages")
}
for i := 0; i < len(jobs); i++ {
job := jobs[len(jobs)-1-i]
err = a.jobApplier.Configure(job, i)
if err != nil {
return bosherr.WrapError(err, "Configuring job %s", job.Name)
}
}
err = a.jobSupervisor.Reload()
if err != nil {
return bosherr.WrapError(err, "Reloading jobSupervisor")
}
return a.setUpLogrotate(desiredApplySpec)
}
开发者ID:keaty,项目名称:bosh-provisioner,代码行数:47,代码来源:concrete_applier.go
注:本文中的github.com/cloudfoundry/bosh-agent/agent/applier/applyspec.ApplySpec类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论