fix a nil pointer ref in slice allocation

Kubernetes-commit: 904d5c45de4e3a5a21eb2eaa648d3ce0b70938ba
This commit is contained in:
Haowei Cai 2020-10-15 17:02:50 -07:00 committed by Kubernetes Publisher
parent db465cf42d
commit 149a38b22e
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,7 @@ func (s *defaultManager) UpdateStorageVersions(kubeAPIServerClientConfig *rest.C
sc := clientset.InternalV1alpha1().StorageVersions()
s.mu.RLock()
resources := make([]*ResourceInfo, len(s.managedResourceInfos))
resources := []*ResourceInfo{}
for resource := range s.managedResourceInfos {
resources = append(resources, resource)
}