Skip to content

Commit

Permalink
Don't reuse api.Scheme and api.Codecs
Browse files Browse the repository at this point in the history
  • Loading branch information
wfarr committed Nov 14, 2016
1 parent 3806ead commit 10a1750
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/third_party_resources/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ func configureClient(config *rest.Config) {
config.GroupVersion = &groupversion
config.APIPath = "/apis"
config.ContentType = runtime.ContentTypeJSON
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}

scheme := runtime.NewScheme()
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: serializer.NewCodecFactory(scheme)}

schemeBuilder := runtime.NewSchemeBuilder(
func(scheme *runtime.Scheme) error {
Expand All @@ -151,5 +153,5 @@ func configureClient(config *rest.Config) {
)
return nil
})
schemeBuilder.AddToScheme(api.Scheme)
schemeBuilder.AddToScheme(scheme)
}

0 comments on commit 10a1750

Please sign in to comment.