Skip to content

Commit 7dfd3c9

Browse files
committed
client: Use dynamic RESTMapper by default
This commit changes the client package to use the dynamic RESTMapper by default. The default RESTMapper caches the discovery endpoint results once and never updates them. Because of that, if an api-resource is added after the client is started, the client will mistakenly think the api-resource doesn't exist. Signed-off-by: Yannis Zarkadas <[email protected]>
1 parent efbeb27 commit 7dfd3c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func New(config *rest.Config, options Options) (Client, error) {
6464
// Init a Mapper if none provided
6565
if options.Mapper == nil {
6666
var err error
67-
options.Mapper, err = apiutil.NewDiscoveryRESTMapper(config)
67+
options.Mapper, err = apiutil.NewDynamicRESTMapper(config)
6868
if err != nil {
6969
return nil, err
7070
}

0 commit comments

Comments
 (0)