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


Golang Interface.Experimental方法代码示例

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


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

示例1: deleteAllContent

// deleteAllContent will delete all content known to the system in a namespace. It returns an estimate
// of the time remaining before the remaining resources are deleted. If estimate > 0 not all resources
// are guaranteed to be gone.
func deleteAllContent(kubeClient client.Interface, experimentalMode bool, namespace string, before unversioned.Time) (estimate int64, err error) {
	err = deleteServiceAccounts(kubeClient, namespace)
	if err != nil {
		return estimate, err
	}
	err = deleteServices(kubeClient, namespace)
	if err != nil {
		return estimate, err
	}
	err = deleteReplicationControllers(kubeClient, namespace)
	if err != nil {
		return estimate, err
	}
	estimate, err = deletePods(kubeClient, namespace, before)
	if err != nil {
		return estimate, err
	}
	err = deleteSecrets(kubeClient, namespace)
	if err != nil {
		return estimate, err
	}
	err = deletePersistentVolumeClaims(kubeClient, namespace)
	if err != nil {
		return estimate, err
	}
	err = deleteLimitRanges(kubeClient, namespace)
	if err != nil {
		return estimate, err
	}
	err = deleteResourceQuotas(kubeClient, namespace)
	if err != nil {
		return estimate, err
	}
	err = deleteEvents(kubeClient, namespace)
	if err != nil {
		return estimate, err
	}
	// If experimental mode, delete all experimental resources for the namespace.
	if experimentalMode {
		err = deleteHorizontalPodAutoscalers(kubeClient.Experimental(), namespace)
		if err != nil {
			return estimate, err
		}
		err = deleteDaemonSets(kubeClient.Experimental(), namespace)
		if err != nil {
			return estimate, err
		}
		err = deleteJobs(kubeClient.Experimental(), namespace)
		if err != nil {
			return estimate, err
		}
		err = deleteDeployments(kubeClient.Experimental(), namespace)
		if err != nil {
			return estimate, err
		}
	}
	return estimate, nil
}
开发者ID:F21,项目名称:kubernetes,代码行数:61,代码来源:namespace_controller.go

示例2: New

func New(client client.Interface) *DeploymentController {
	eventBroadcaster := record.NewBroadcaster()
	eventBroadcaster.StartLogging(glog.Infof)
	eventBroadcaster.StartRecordingToSink(client.Events(""))

	return &DeploymentController{
		client:        client,
		expClient:     client.Experimental(),
		eventRecorder: eventBroadcaster.NewRecorder(api.EventSource{Component: "deployment-controller"}),
	}
}
开发者ID:niujie4,项目名称:kubernetes,代码行数:11,代码来源:deployment_controller.go

示例3: New

func New(client client.Interface) *DeploymentController {
	return &DeploymentController{
		client:    client,
		expClient: client.Experimental(),
	}
}
开发者ID:jalvarezsamayoa,项目名称:kubernetes,代码行数:6,代码来源:deployment_controller.go


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