k8s/io/kubernetes/pkg/api/unversioned.APIResource 示例代码

2022-03-03

以下示例是关于golang中包含unversioned.APIResource用法的示例代码,想了解unversioned.APIResource的具体用法?unversioned.APIResource怎么用?unversioned.APIResource使用的例子?那么可以参考以下10个相关示例代码来学习它的具体使用方法。

示例1:
namespace_controller_utils.go开发语言: Go项目名称: amygdala代码行数: 480
156
157	apiResource := unversioned.APIResource{Name: gvr.Resource, Namespaced: true}
158	err := dynamicClient.Resource(&apiResource, namespace).DeleteCollection(nil, v1.ListOptions{})
198
199	apiResource := unversioned.APIResource{Name: gvr.Resource, Namespaced: true}
200	unstructuredList, err := dynamicClient.Resource(&apiResource, namespace).List(v1.ListOptions{})
235	}
236	apiResource := unversioned.APIResource{Name: gvr.Resource, Namespaced: true}
237	for _, item := range unstructuredList.Items {
示例2:
api_installer.go开发语言: Go项目名称: amygdala代码行数: 975
65// Installs handlers for API resources.
66func (a *APIInstaller) Install(ws *restful.WebService) (apiResources []unversioned.APIResource, errors []error) {
67	errors = make([]error, 0)
169
170func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storage, ws *restful.WebService, proxyHandler http.Handler) (*unversioned.APIResource, error) {
171	admit := a.group.Admit
331
332	var apiResource unversioned.APIResource
333	// Get the list of actions for the given scope.
示例3:
client_test.go开发语言: Go项目名称: amygdala代码行数: 481
121		gv := &unversioned.GroupVersion{Group: "gtest", Version: "vtest"}
122		resource := &unversioned.APIResource{Name: "rtest", Namespaced: len(tc.namespace) != 0}
123		cl, srv, err := getClientServer(gv, func(w http.ResponseWriter, r *http.Request) {
175		gv := &unversioned.GroupVersion{Group: "gtest", Version: "vtest"}
176		resource := &unversioned.APIResource{Name: "rtest", Namespaced: len(tc.namespace) != 0}
177		cl, srv, err := getClientServer(gv, func(w http.ResponseWriter, r *http.Request) {
227		gv := &unversioned.GroupVersion{Group: "gtest", Version: "vtest"}
228		resource := &unversioned.APIResource{Name: "rtest", Namespaced: len(tc.namespace) != 0}
229		cl, srv, err := getClientServer(gv, func(w http.ResponseWriter, r *http.Request) {
275		gv := &unversioned.GroupVersion{Group: "gtest", Version: "vtest"}
276		resource := &unversioned.APIResource{Name: "rtest", Namespaced: len(tc.namespace) != 0}
277		cl, srv, err := getClientServer(gv, func(w http.ResponseWriter, r *http.Request) {
322		gv := &unversioned.GroupVersion{Group: "gtest", Version: "vtest"}
323		resource := &unversioned.APIResource{Name: "rtest", Namespaced: len(tc.namespace) != 0}
324		cl, srv, err := getClientServer(gv, func(w http.ResponseWriter, r *http.Request) {
示例4:
garbagecollector.go开发语言: Go项目名称: cjcullen代码行数: 800
457			// APIResource.Namespaced as false is all right.
458			apiResource := unversioned.APIResource{Name: resource.Resource}
459			return client.ParameterCodec(dynamic.VersionedParameterEncoderWithV1Fallback).
467			// APIResource.Namespaced as false is all right.
468			apiResource := unversioned.APIResource{Name: resource.Resource}
469			return client.ParameterCodec(dynamic.VersionedParameterEncoderWithV1Fallback).
593// apiResource consults the REST mapper to translate an <apiVersion, kind,
594// namespace> tuple to a unversioned.APIResource struct.
595func (gc *GarbageCollector) apiResource(apiVersion, kind string, namespaced bool) (*unversioned.APIResource, error) {
601	glog.V(6).Infof("map kind %s, version %s to resource %s", kind, apiVersion, mapping.Resource)
602	resource := unversioned.APIResource{
603		Name:       mapping.Resource,
示例5:
garbagecollector.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 793
454			// APIResource.Namespaced as false is all right.
455			apiResource := unversioned.APIResource{Name: resource.Resource}
456			return client.ParameterCodec(dynamic.VersionedParameterEncoderWithV1Fallback).
464			// APIResource.Namespaced as false is all right.
465			apiResource := unversioned.APIResource{Name: resource.Resource}
466			return client.ParameterCodec(dynamic.VersionedParameterEncoderWithV1Fallback).
586// apiResource consults the REST mapper to translate an <apiVersion, kind,
587// namespace> tuple to a unversioned.APIResource struct.
588func (gc *GarbageCollector) apiResource(apiVersion, kind string, namespaced bool) (*unversioned.APIResource, error) {
594	glog.V(6).Infof("map kind %s, version %s to resource %s", kind, apiVersion, mapping.Resource)
595	resource := unversioned.APIResource{
596		Name:       mapping.Resource,
示例6:
generated.pb.go开发语言: Go项目名称: cjcullen代码行数: 4537
180	proto.RegisterType((*APIGroupList)(nil), "k8s.io.kubernetes.pkg.api.unversioned.APIGroupList")
181	proto.RegisterType((*APIResource)(nil), "k8s.io.kubernetes.pkg.api.unversioned.APIResource")
182	proto.RegisterType((*APIResourceList)(nil), "k8s.io.kubernetes.pkg.api.unversioned.APIResourceList")
示例7:
generated.pb.go开发语言: Go项目名称: cjcullen代码行数: 4537
180	proto.RegisterType((*APIGroupList)(nil), "k8s.io.client-go.pkg.api.unversioned.APIGroupList")
181	proto.RegisterType((*APIResource)(nil), "k8s.io.client-go.pkg.api.unversioned.APIResource")
182	proto.RegisterType((*APIResourceList)(nil), "k8s.io.client-go.pkg.api.unversioned.APIResourceList")
示例8:
generated.pb.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 4536
180	proto.RegisterType((*APIGroupList)(nil), "k8s.io.kubernetes.pkg.api.unversioned.APIGroupList")
181	proto.RegisterType((*APIResource)(nil), "k8s.io.kubernetes.pkg.api.unversioned.APIResource")
182	proto.RegisterType((*APIResourceList)(nil), "k8s.io.kubernetes.pkg.api.unversioned.APIResourceList")
示例9:
generated.pb.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 4536
180	proto.RegisterType((*APIGroupList)(nil), "k8s.io.client-go.1.4.pkg.api.unversioned.APIGroupList")
181	proto.RegisterType((*APIResource)(nil), "k8s.io.client-go.1.4.pkg.api.unversioned.APIResource")
182	proto.RegisterType((*APIResourceList)(nil), "k8s.io.client-go.1.4.pkg.api.unversioned.APIResourceList")
示例10:
api_installer.go开发语言: Go项目名称: cjcullen代码行数: 1039
67// Installs handlers for API resources.
68func (a *APIInstaller) Install(ws *restful.WebService) (apiResources []unversioned.APIResource, errors []error) {
69	errors = make([]error, 0)
171
172func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storage, ws *restful.WebService, proxyHandler http.Handler) (*unversioned.APIResource, error) {
173	admit := a.group.Admit
351
352	var apiResource unversioned.APIResource
353	// Get the list of actions for the given scope.

本文地址:https://www.itbaoku.cn/snippets/415806.html