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