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


Golang Interface.BatchV2alpha1方法代码示例

本文整理汇总了Golang中k8s/io/kubernetes/pkg/client/clientset_generated/release_1_5.Interface.BatchV2alpha1方法的典型用法代码示例。如果您正苦于以下问题:Golang Interface.BatchV2alpha1方法的具体用法?Golang Interface.BatchV2alpha1怎么用?Golang Interface.BatchV2alpha1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在k8s/io/kubernetes/pkg/client/clientset_generated/release_1_5.Interface的用法示例。


在下文中一共展示了Interface.BatchV2alpha1方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: waitForActiveJobs

// Wait for at least given amount of active jobs.
func waitForActiveJobs(c clientset.Interface, ns, cronJobName string, active int) error {
	return wait.Poll(framework.Poll, cronJobTimeout, func() (bool, error) {
		curr, err := c.BatchV2alpha1().CronJobs(ns).Get(cronJobName, metav1.GetOptions{})
		if err != nil {
			return false, err
		}
		return len(curr.Status.Active) >= active, nil
	})
}
开发者ID:alex-mohr,项目名称:kubernetes,代码行数:10,代码来源:cronjob.go

示例2: waitForNoJobs

// Wait for no jobs to appear.
func waitForNoJobs(c clientset.Interface, ns, jobName string) error {
	return wait.Poll(framework.Poll, cronJobTimeout, func() (bool, error) {
		curr, err := c.BatchV2alpha1().CronJobs(ns).Get(jobName)
		if err != nil {
			return false, err
		}

		return len(curr.Status.Active) != 0, nil
	})
}
开发者ID:nak3,项目名称:kubernetes,代码行数:11,代码来源:cronjob.go

示例3: checkNoUnexpectedEvents

// checkNoUnexpectedEvents checks unexpected events didn't happen.
// Currently only "UnexpectedJob" is checked.
func checkNoUnexpectedEvents(c clientset.Interface, ns, cronJobName string) error {
	sj, err := c.BatchV2alpha1().CronJobs(ns).Get(cronJobName, metav1.GetOptions{})
	if err != nil {
		return fmt.Errorf("error in getting cronjob %s/%s: %v", ns, cronJobName, err)
	}
	events, err := c.Core().Events(ns).Search(sj)
	if err != nil {
		return fmt.Errorf("error in listing events: %s", err)
	}
	for _, e := range events.Items {
		if e.Reason == "UnexpectedJob" {
			return fmt.Errorf("found unexpected event: %#v", e)
		}
	}
	return nil
}
开发者ID:alex-mohr,项目名称:kubernetes,代码行数:18,代码来源:cronjob.go

示例4: newJobInformer

func newJobInformer(client release_1_5.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
	sharedIndexInformer := cache.NewSharedIndexInformer(
		&cache.ListWatch{
			ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
				return client.BatchV2alpha1().Jobs(v1.NamespaceAll).List(options)
			},
			WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
				return client.BatchV2alpha1().Jobs(v1.NamespaceAll).Watch(options)
			},
		},
		&batch_v2alpha1.Job{},
		resyncPeriod,
		cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
	)

	return sharedIndexInformer
}
开发者ID:nak3,项目名称:kubernetes,代码行数:17,代码来源:job.go

示例5: deleteCronJob

func deleteCronJob(c clientset.Interface, ns, name string) error {
	return c.BatchV2alpha1().CronJobs(ns).Delete(name, nil)
}
开发者ID:alex-mohr,项目名称:kubernetes,代码行数:3,代码来源:cronjob.go

示例6: getCronJob

func getCronJob(c clientset.Interface, ns, name string) (*batch.CronJob, error) {
	return c.BatchV2alpha1().CronJobs(ns).Get(name, metav1.GetOptions{})
}
开发者ID:alex-mohr,项目名称:kubernetes,代码行数:3,代码来源:cronjob.go

示例7: createCronJob

func createCronJob(c clientset.Interface, ns string, cronJob *batch.CronJob) (*batch.CronJob, error) {
	return c.BatchV2alpha1().CronJobs(ns).Create(cronJob)
}
开发者ID:alex-mohr,项目名称:kubernetes,代码行数:3,代码来源:cronjob.go


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