mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Remove redundant third-party type registration
Since NewSchemeBuilder registers the supplied Scheme transformation functions synchronously, there's no need for a subsequent call to (*SchemeBuilder).Register against the same instance.
This commit is contained in:
parent
fe3ca9a6eb
commit
3a8e44bda8
@ -38,13 +38,6 @@ func Resource(resource string) schema.GroupResource {
|
|||||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
|
||||||
// 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)
|
|
||||||
}
|
|
||||||
|
|
||||||
// addKnownTypes adds the set of types defined in this package to the supplied scheme.
|
// addKnownTypes adds the set of types defined in this package to the supplied scheme.
|
||||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||||
|
Loading…
Reference in New Issue
Block a user