Skip to content

Commit 43a3cd8

Browse files
authored
Merge pull request #622 from enxebre/fix-613
🐛Prevent NewDiscoveryRESTMapper from panicking by calling NewDiscoveryClientForConfig
2 parents 5f0aee6 + 95b14b1 commit 43a3cd8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/client/apiutil/apimachinery.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ import (
3535
// information fetched by a new client with the given config.
3636
func NewDiscoveryRESTMapper(c *rest.Config) (meta.RESTMapper, error) {
3737
// Get a mapper
38-
dc := discovery.NewDiscoveryClientForConfigOrDie(c)
38+
dc, err := discovery.NewDiscoveryClientForConfig(c)
39+
if err != nil {
40+
return nil, err
41+
}
3942
gr, err := restmapper.GetAPIGroupResources(dc)
4043
if err != nil {
4144
return nil, err

0 commit comments

Comments
 (0)