本文整理匯總了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)
}
示例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
}