Skip to content

Commit a2ef324

Browse files
hoskerik8s-publishing-bot
authored andcommitted
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 <[email protected]> Kubernetes-commit: f8b99b1f09fb5d4d10b15e326c4b242cc705f007
1 parent 236db3c commit a2ef324

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

discovery/discovery_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func (d *DiscoveryClient) GroupsAndMaybeResources() (*metav1.APIGroupList, map[s
196196
}
197197
// Discovery groups and (possibly) resources downloaded from /apis.
198198
apiGroups, apiResources, aerr := d.downloadAPIs()
199-
if err != nil {
199+
if aerr != nil {
200200
return nil, nil, aerr
201201
}
202202
// Merge apis groups into the legacy groups.

0 commit comments

Comments
 (0)