当前位置: 首页>>代码示例>>Golang>>正文


Golang Scheme.AddKnownTypeWithName方法代码示例

本文整理汇总了Golang中k8s/io/client-go/pkg/runtime.Scheme.AddKnownTypeWithName方法的典型用法代码示例。如果您正苦于以下问题:Golang Scheme.AddKnownTypeWithName方法的具体用法?Golang Scheme.AddKnownTypeWithName怎么用?Golang Scheme.AddKnownTypeWithName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在k8s/io/client-go/pkg/runtime.Scheme的用法示例。


在下文中一共展示了Scheme.AddKnownTypeWithName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: AddToGroupVersion

// AddToGroupVersion registers the watch external and internal kinds with the scheme, and ensures the proper
// conversions are in place.
func AddToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion) {
	scheme.AddKnownTypeWithName(groupVersion.WithKind(WatchEventKind), &Event{})
	scheme.AddKnownTypeWithName(
		schema.GroupVersion{Group: groupVersion.Group, Version: runtime.APIVersionInternal}.WithKind(WatchEventKind),
		&InternalEvent{},
	)
	scheme.AddConversionFuncs(
		Convert_versioned_Event_to_watch_Event,
		Convert_versioned_InternalEvent_to_versioned_Event,
		Convert_watch_Event_to_versioned_Event,
		Convert_versioned_Event_to_versioned_InternalEvent,
	)
}
开发者ID:alex-mohr,项目名称:kubernetes,代码行数:15,代码来源:register.go

示例2: addKnownTypes

// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
	scheme.AddKnownTypes(SchemeGroupVersion,
		&Job{},
		&JobList{},
		&JobTemplate{},
		&CronJob{},
		&CronJobList{},
		&api.ListOptions{},
	)
	scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("ScheduledJob"), &CronJob{})
	scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("ScheduledJobList"), &CronJobList{})
	return nil
}
开发者ID:eljefedelrodeodeljefe,项目名称:kubernetes,代码行数:14,代码来源:register.go

示例3: addKnownTypes

// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
	scheme.AddKnownTypes(SchemeGroupVersion,
		&Job{},
		&JobList{},
		&JobTemplate{},
		&CronJob{},
		&CronJobList{},
		&v1.ListOptions{},
		&v1.DeleteOptions{},
	)
	scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("ScheduledJob"), &CronJob{})
	scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("ScheduledJobList"), &CronJobList{})
	versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion)
	return nil
}
开发者ID:alex-mohr,项目名称:kubernetes,代码行数:16,代码来源:register.go


注:本文中的k8s/io/client-go/pkg/runtime.Scheme.AddKnownTypeWithName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。