From cf02f61989c1efa391e75acd31476c2bb45ea684 Mon Sep 17 00:00:00 2001 From: Laurence <45508533+LaurenceLiZhixin@users.noreply.github.com> Date: Wed, 7 Dec 2022 11:37:18 +0800 Subject: [PATCH] fix: dm npe (#1088) --- pkg/yurthub/kubernetes/meta/restmapper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/yurthub/kubernetes/meta/restmapper.go b/pkg/yurthub/kubernetes/meta/restmapper.go index e3354466cae..7a2bf8102ed 100644 --- a/pkg/yurthub/kubernetes/meta/restmapper.go +++ b/pkg/yurthub/kubernetes/meta/restmapper.go @@ -77,7 +77,7 @@ func NewDefaultRESTMapperFromScheme() *meta.DefaultRESTMapper { } func NewRESTMapperManager(baseDir string) (*RESTMapperManager, error) { - var dm map[schema.GroupVersionResource]schema.GroupVersionKind + dm := make(map[schema.GroupVersionResource]schema.GroupVersionKind) cachedFilePath := filepath.Join(baseDir, CacheDynamicRESTMapperKey) // Recover the mapping relationship between GVR and GVK from the hard disk storage := fs.FileSystemOperator{}