本文整理汇总了Golang中vulcan/kubernetes/pkg/client/unversioned.Client.Extensions方法的典型用法代码示例。如果您正苦于以下问题:Golang Client.Extensions方法的具体用法?Golang Client.Extensions怎么用?Golang Client.Extensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vulcan/kubernetes/pkg/client/unversioned.Client
的用法示例。
在下文中一共展示了Client.Extensions方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: waitForJobFinish
// Wait for job to reach completions.
func waitForJobFinish(c *client.Client, ns, jobName string, completions int) error {
return wait.Poll(poll, jobTimeout, func() (bool, error) {
curr, err := c.Extensions().Jobs(ns).Get(jobName)
if err != nil {
return false, err
}
return curr.Status.Succeeded == completions, nil
})
}
示例2: createIngress
// createIngress creates an Ingress with num rules. Eg:
// start = 1 num = 2 will given you a single Ingress with 2 rules:
// Ingress {
// foo1.bar.com: /foo1
// foo2.bar.com: /foo2
// }
func createIngress(c *client.Client, ns string, start, num int) extensions.Ingress {
ing := extensions.Ingress{
ObjectMeta: api.ObjectMeta{
Name: fmt.Sprintf("%v%d", appPrefix, start),
Namespace: ns,
},
Spec: extensions.IngressSpec{
Backend: &extensions.IngressBackend{
ServiceName: fmt.Sprintf("%v%d", appPrefix, start),
ServicePort: util.NewIntOrStringFromInt(httpContainerPort),
},
Rules: []extensions.IngressRule{},
},
}
for i := start; i < start+num; i++ {
ing.Spec.Rules = append(ing.Spec.Rules, ruleByIndex(i))
}
Logf("Creating ingress %v", start)
_, err := c.Extensions().Ingress(ns).Create(&ing)
Expect(err).NotTo(HaveOccurred())
return ing
}
示例3:
// gce project, just back off.
Expect(ingController.cleanup(false)).NotTo(HaveOccurred())
responseTimes = []time.Duration{}
creationTimes = []time.Duration{}
})
AfterEach(func() {
Logf("Average creation time %+v, health check time %+v", creationTimes, responseTimes)
if CurrentGinkgoTestDescription().Failed {
kubectlLogLBController(client, ns)
Logf("\nOutput of kubectl describe ing:\n")
desc, _ := runKubectl("describe", "ing", fmt.Sprintf("--namespace=%v", ns))
Logf(desc)
}
// Delete all Ingress, then wait for the controller to cleanup.
ings, err := client.Extensions().Ingress(ns).List(
labels.Everything(), fields.Everything())
if err != nil {
Logf("WARNING: Failed to list ingress: %+v", err)
} else {
for _, ing := range ings.Items {
Logf("Deleting ingress %v/%v", ing.Namespace, ing.Name)
if err := client.Extensions().Ingress(ns).Delete(ing.Name, nil); err != nil {
Logf("WARNING: Failed to delete ingress %v: %v", ing.Name, err)
}
}
}
pollErr := wait.Poll(5*time.Second, lbCleanupTimeout, func() (bool, error) {
if err := ingController.cleanup(false); err != nil {
Logf("Still waiting for glbc to cleanup: %v", err)
return false, nil
示例4: deleteJob
func deleteJob(c *client.Client, ns, name string) error {
return c.Extensions().Jobs(ns).Delete(name, api.NewDeleteOptions(0))
}
示例5: createJob
func createJob(c *client.Client, ns string, job *extensions.Job) (*extensions.Job, error) {
return c.Extensions().Jobs(ns).Create(job)
}
示例6: ingressWatchFunc
func ingressWatchFunc(c *client.Client, ns string) func(options api.ListOptions) (watch.Interface, error) {
return func(options api.ListOptions) (watch.Interface, error) {
return c.Extensions().Ingress(ns).Watch(
labels.Everything(), fields.Everything(), options)
}
}
示例7: ingressListFunc
func ingressListFunc(c *client.Client, ns string) func() (runtime.Object, error) {
return func() (runtime.Object, error) {
return c.Extensions().Ingress(ns).List(labels.Everything(), fields.Everything())
}
}