本文整理汇总了Golang中github.com/openshift/origin/pkg/deploy/api.DeploymentStatus函数的典型用法代码示例。如果您正苦于以下问题:Golang DeploymentStatus函数的具体用法?Golang DeploymentStatus怎么用?Golang DeploymentStatus使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DeploymentStatus函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: LatestDeploymentInfo
// LatestDeploymentInfo returns info about the latest deployment for a config,
// if it exists and its current status
func LatestDeploymentInfo(config *deployapi.DeploymentConfig, deployments *api.ReplicationControllerList) (bool, deployapi.DeploymentStatus) {
if config.LatestVersion == 0 || len(deployments.Items) == 0 {
return false, deployapi.DeploymentStatus("")
}
sort.Sort(ByLatestVersionDesc(deployments.Items))
candidate := &deployments.Items[0]
return DeploymentVersionFor(candidate) == config.LatestVersion, DeploymentStatusFor(candidate)
}
示例2: DeploymentStatusFor
func DeploymentStatusFor(obj runtime.Object) deployapi.DeploymentStatus {
return deployapi.DeploymentStatus(annotationFor(obj, deployapi.DeploymentStatusAnnotation))
}
示例3:
out, err := oc.Run("create").Args("-f", deploymentFixture).Output()
o.Expect(err).NotTo(o.HaveOccurred())
out, err = oc.Run("logs").Args("-f", "dc/deployment-test").Output()
o.Expect(err).NotTo(o.HaveOccurred())
g.By(fmt.Sprintf("checking the logs for substrings\n%s", out))
o.Expect(out).To(o.ContainSubstring("deployment-test-1 to 2"))
o.Expect(out).To(o.ContainSubstring("Pre hook finished"))
o.Expect(out).To(o.ContainSubstring("Deployment deployment-test-1 successfully made active"))
g.By("verifying the deployment is marked complete and scaled to zero")
err = wait.Poll(100*time.Millisecond, 1*time.Minute, func() (bool, error) {
rc, err := oc.KubeREST().ReplicationControllers(oc.Namespace()).Get("deployment-test-1")
o.Expect(err).NotTo(o.HaveOccurred())
status := rc.Annotations[deployapi.DeploymentStatusAnnotation]
if deployapi.DeploymentStatus(status) != deployapi.DeploymentStatusComplete {
return false, nil
}
if rc.Spec.Replicas != 0 {
return false, nil
}
if rc.Status.Replicas != 0 {
return false, nil
}
return true, nil
})
o.Expect(err).NotTo(o.HaveOccurred())
g.By("verifying that scaling does not result in new pods")
out, err = oc.Run("scale").Args("dc/deployment-test", "--replicas=1").Output()
o.Expect(err).NotTo(o.HaveOccurred())