本文整理汇总了Golang中k8s/io/kubernetes/test/e2e/framework.CheckTestingNSDeletedExcept函数的典型用法代码示例。如果您正苦于以下问题:Golang CheckTestingNSDeletedExcept函数的具体用法?Golang CheckTestingNSDeletedExcept怎么用?Golang CheckTestingNSDeletedExcept使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CheckTestingNSDeletedExcept函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
By("Cleaning up the replication controller")
err := framework.DeleteRCAndPods(c, f.ClientSet, ns, RCName)
framework.ExpectNoError(err)
}
})
BeforeEach(func() {
c = f.Client
cs = f.ClientSet
ns = f.Namespace.Name
nodeList = &api.NodeList{}
framework.WaitForAllNodesHealthy(c, time.Minute)
masterNodes, nodeList = framework.GetMasterAndWorkerNodesOrDie(c)
err := framework.CheckTestingNSDeletedExcept(c, ns)
framework.ExpectNoError(err)
// Every test case in this suite assumes that cluster add-on pods stay stable and
// cannot be run in parallel with any other test that touches Nodes or Pods.
// It is so because we need to have precise control on what's running in the cluster.
systemPods, err := framework.GetPodsInNamespace(c, ns, ignoreLabels)
Expect(err).NotTo(HaveOccurred())
systemPodsNo = 0
for _, pod := range systemPods {
if !masterNodes.Has(pod.Spec.NodeName) && pod.DeletionTimestamp == nil {
systemPodsNo++
}
}
err = framework.WaitForPodsRunningReady(c, api.NamespaceSystem, int32(systemPodsNo), framework.PodReadyBeforeTimeout, ignoreLabels)
示例2:
clientset = f.ClientSet
// In large clusters we may get to this point but still have a bunch
// of nodes without Routes created. Since this would make a node
// unschedulable, we need to wait until all of them are schedulable.
framework.ExpectNoError(framework.WaitForAllNodesSchedulable(clientset))
ns = f.Namespace.Name
nodes := framework.GetReadySchedulableNodesOrDie(clientset)
nodeCount = len(nodes.Items)
Expect(nodeCount).NotTo(BeZero())
// Terminating a namespace (deleting the remaining objects from it - which
// generally means events) can affect the current run. Thus we wait for all
// terminating namespace to be finally deleted before starting this test.
err := framework.CheckTestingNSDeletedExcept(clientset, ns)
framework.ExpectNoError(err)
framework.ExpectNoError(framework.ResetMetrics(clientset))
})
type Load struct {
podsPerNode int
image string
command []string
}
loadTests := []Load{
// The container will consume 1 cpu and 512mb of memory.
{podsPerNode: 3, image: "jess/stress", command: []string{"stress", "-c", "1", "-m", "2"}},
{podsPerNode: 30, image: "gcr.io/google_containers/serve_hostname:v1.4"},