mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-24 06:07:48 +00:00
Copyedit third-party resource registration example
Kubernetes-commit: fe3ca9a6eba9b39a305b8cdffc2fbc7a66b812da
This commit is contained in:
parent
8debebccfb
commit
87c960d69b
@ -27,25 +27,25 @@ var (
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// GroupName is the group name use in this package
|
||||
// GroupName is the group name use in this package.
|
||||
const GroupName = "tpr.client-go.k8s.io"
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
// SchemeGroupVersion is the group version used to register these objects.
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
// Resource takes an unqualified resource and returns a Group-qualified GroupResource.
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
func init() {
|
||||
// We only register manually written functions here. The registration of the
|
||||
// We only register manually-written functions here. The registration of the
|
||||
// generated functions takes place in the generated files. The separation
|
||||
// makes the code compile even when the generated files are missing.
|
||||
SchemeBuilder.Register(addKnownTypes)
|
||||
}
|
||||
|
||||
// Adds the list of known types to api.Scheme.
|
||||
// addKnownTypes adds the set of types defined in this package to the supplied scheme.
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&Example{},
|
||||
|
Loading…
Reference in New Issue
Block a user