当前位置: 首页>>代码示例>>Golang>>正文


Golang api.DeploymentStatus函数代码示例

本文整理汇总了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)
}
开发者ID:sztsian,项目名称:origin,代码行数:10,代码来源:util.go

示例2: DeploymentStatusFor

func DeploymentStatusFor(obj runtime.Object) deployapi.DeploymentStatus {
	return deployapi.DeploymentStatus(annotationFor(obj, deployapi.DeploymentStatusAnnotation))
}
开发者ID:johnmccawley,项目名称:origin,代码行数:3,代码来源:util.go

示例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())
开发者ID:Thomas-T,项目名称:origin,代码行数:31,代码来源:test_deployments.go


注:本文中的github.com/openshift/origin/pkg/deploy/api.DeploymentStatus函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。