mirror of
https://github.com/kubernetes/client-go.git
synced 2025-12-26 14:42:27 +00:00
Check the correct error in d.downloadAPIs
The error result of `d.downloadAPIs()` is set in `aerr`, not `err`. This prevents a nil-ptr dereference of apiGroups in the next step. Signed-off-by: Abhijit Hoskeri <abhijithoskeri@gmail.com> Kubernetes-commit: f8b99b1f09fb5d4d10b15e326c4b242cc705f007
This commit is contained in:
committed by
Kubernetes Publisher
parent
236db3c56e
commit
a2ef32442a
@@ -196,7 +196,7 @@ func (d *DiscoveryClient) GroupsAndMaybeResources() (*metav1.APIGroupList, map[s
|
||||
}
|
||||
// Discovery groups and (possibly) resources downloaded from /apis.
|
||||
apiGroups, apiResources, aerr := d.downloadAPIs()
|
||||
if err != nil {
|
||||
if aerr != nil {
|
||||
return nil, nil, aerr
|
||||
}
|
||||
// Merge apis groups into the legacy groups.
|
||||
|
||||
Reference in New Issue
Block a user