當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。