當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Interface.Apps方法代碼示例

本文整理匯總了Golang中k8s/io/kubernetes/pkg/client/unversioned.Interface.Apps方法的典型用法代碼示例。如果您正苦於以下問題:Golang Interface.Apps方法的具體用法?Golang Interface.Apps怎麽用?Golang Interface.Apps使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在k8s/io/kubernetes/pkg/client/unversioned.Interface的用法示例。


在下文中一共展示了Interface.Apps方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: ScalerFor

func ScalerFor(kind unversioned.GroupKind, c client.Interface) (Scaler, error) {
	switch kind {
	case api.Kind("ReplicationController"):
		return &ReplicationControllerScaler{c}, nil
	case extensions.Kind("ReplicaSet"):
		return &ReplicaSetScaler{c.Extensions()}, nil
	case extensions.Kind("Job"), batch.Kind("Job"):
		return &JobScaler{c.Batch()}, nil // Either kind of job can be scaled with Batch interface.
	case apps.Kind("PetSet"):
		return &PetSetScaler{c.Apps()}, nil
	case extensions.Kind("Deployment"):
		return &DeploymentScaler{c.Extensions()}, nil
	}
	return nil, fmt.Errorf("no scaler has been implemented for %q", kind)
}
開發者ID:nhr,項目名稱:origin,代碼行數:15,代碼來源:scale.go

示例2: toPetSetPodController

func toPetSetPodController(client k8sClient.Interface, reference api.ObjectReference, pods []api.Pod, events []api.Event, heapsterClient client.HeapsterClient) (*Controller, error) {
	petset, err := client.Apps().PetSets(reference.Namespace).Get(reference.Name)
	if err != nil {
		return nil, err
	}
	petsets := []apps.PetSet{*petset}

	petSetList := petsetlist.CreatePetSetList(petsets, pods, events, dataselect.StdMetricsDataSelect, &heapsterClient)
	return &Controller{
		Kind:       "PetSet",
		PetSetList: petSetList,
	}, nil
}
開發者ID:cheld,項目名稱:dashboard,代碼行數:13,代碼來源:poddetail.go


注:本文中的k8s/io/kubernetes/pkg/client/unversioned.Interface.Apps方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。