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

2022-03-03

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

示例1:
cmd_test.go开发语言: Go项目名称: amygdala代码行数: 734
77func (obj *internalType) GroupVersionKind() *unversioned.GroupVersionKind {
78	return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
79}
84func (obj *externalType) GroupVersionKind() *unversioned.GroupVersionKind {
85	return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
86}
91func (obj *ExternalType2) GroupVersionKind() *unversioned.GroupVersionKind {
92	return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
93}
示例2:
meta_test.go开发语言: Go项目名称: amygdala代码行数: 778
259func (obj *InternalObject) GroupVersionKind() *unversioned.GroupVersionKind {
260	return unversioned.FromAPIVersionAndKind(obj.TypeMeta.APIVersion, obj.TypeMeta.Kind)
261}
616func (obj *MyAPIObject) GroupVersionKind() *unversioned.GroupVersionKind {
617	return unversioned.FromAPIVersionAndKind(obj.TypeMeta.APIVersion, obj.TypeMeta.Kind)
618}
示例3:
garbagecollector.go开发语言: Go项目名称: cjcullen代码行数: 800
595func (gc *GarbageCollector) apiResource(apiVersion, kind string, namespaced bool) (*unversioned.APIResource, error) {
596	fqKind := unversioned.FromAPIVersionAndKind(apiVersion, kind)
597	mapping, err := gc.restMapper.RESTMapping(fqKind.GroupKind(), apiVersion)
610func (gc *GarbageCollector) deleteObject(item objectReference) error {
611	fqKind := unversioned.FromAPIVersionAndKind(item.APIVersion, item.Kind)
612	client, err := gc.clientPool.ClientForGroupVersionKind(fqKind)
624func (gc *GarbageCollector) getObject(item objectReference) (*runtime.Unstructured, error) {
625	fqKind := unversioned.FromAPIVersionAndKind(item.APIVersion, item.Kind)
626	client, err := gc.clientPool.ClientForGroupVersionKind(fqKind)
635func (gc *GarbageCollector) updateObject(item objectReference, obj *runtime.Unstructured) (*runtime.Unstructured, error) {
636	fqKind := unversioned.FromAPIVersionAndKind(item.APIVersion, item.Kind)
637	client, err := gc.clientPool.ClientForGroupVersionKind(fqKind)
646func (gc *GarbageCollector) patchObject(item objectReference, patch []byte) (*runtime.Unstructured, error) {
647	fqKind := unversioned.FromAPIVersionAndKind(item.APIVersion, item.Kind)
648	client, err := gc.clientPool.ClientForGroupVersionKind(fqKind)
示例4:
garbagecollector.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 793
588func (gc *GarbageCollector) apiResource(apiVersion, kind string, namespaced bool) (*unversioned.APIResource, error) {
589	fqKind := unversioned.FromAPIVersionAndKind(apiVersion, kind)
590	mapping, err := gc.restMapper.RESTMapping(fqKind.GroupKind(), apiVersion)
603func (gc *GarbageCollector) deleteObject(item objectReference) error {
604	fqKind := unversioned.FromAPIVersionAndKind(item.APIVersion, item.Kind)
605	client, err := gc.clientPool.ClientForGroupVersion(fqKind.GroupVersion())
617func (gc *GarbageCollector) getObject(item objectReference) (*runtime.Unstructured, error) {
618	fqKind := unversioned.FromAPIVersionAndKind(item.APIVersion, item.Kind)
619	client, err := gc.clientPool.ClientForGroupVersion(fqKind.GroupVersion())
628func (gc *GarbageCollector) updateObject(item objectReference, obj *runtime.Unstructured) (*runtime.Unstructured, error) {
629	fqKind := unversioned.FromAPIVersionAndKind(item.APIVersion, item.Kind)
630	client, err := gc.clientPool.ClientForGroupVersion(fqKind.GroupVersion())
639func (gc *GarbageCollector) patchObject(item objectReference, patch []byte) (*runtime.Unstructured, error) {
640	fqKind := unversioned.FromAPIVersionAndKind(item.APIVersion, item.Kind)
641	client, err := gc.clientPool.ClientForGroupVersion(fqKind.GroupVersion())
示例5:
fake.go开发语言: Go项目名称: cjcullen代码行数: 587
70func (obj *InternalType) GroupVersionKind() unversioned.GroupVersionKind {
71	return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
72}
77func (obj *ExternalType) GroupVersionKind() unversioned.GroupVersionKind {
78	return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
79}
84func (obj *ExternalType2) GroupVersionKind() unversioned.GroupVersionKind {
85	return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
86}
示例6:
cmd_test.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 858
94func (obj *internalType) GroupVersionKind() unversioned.GroupVersionKind {
95	return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
96}
101func (obj *externalType) GroupVersionKind() unversioned.GroupVersionKind {
102	return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
103}
108func (obj *ExternalType2) GroupVersionKind() unversioned.GroupVersionKind {
109	return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
110}
示例7:
scheme_test.go开发语言: Go项目名称: amygdala代码行数: 673
476func (obj *MyWeirdCustomEmbeddedVersionKindField) GroupVersionKind() *unversioned.GroupVersionKind {
477	return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.ObjectKind)
478}
示例8:
codec_test.go开发语言: Go项目名称: amygdala代码行数: 400
135func (obj *MyWeirdCustomEmbeddedVersionKindField) GroupVersionKind() *unversioned.GroupVersionKind {
136	return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.ObjectKind)
137}
示例9:
register.go开发语言: Go项目名称: amygdala代码行数: 65
29func (obj *TypeMeta) GroupVersionKind() *unversioned.GroupVersionKind {
30	return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
31}
示例10:
register.go开发语言: Go项目名称: amygdala代码行数: 40
38func (obj *Config) GroupVersionKind() *unversioned.GroupVersionKind {
39	return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
40}

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