Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: redhat-developer/odo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: de540d62fb877408c409883b0e8ebf58048d1521
Choose a base ref
..
head repository: redhat-developer/odo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7807c6c4d6296a33869ace94bc7765a0d29646e4
Choose a head ref
Showing with 4 additions and 0 deletions.
  1. +4 −0 pkg/kclient/all.go
4 changes: 4 additions & 0 deletions pkg/kclient/all.go
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/discovery"
"k8s.io/client-go/dynamic"
"k8s.io/klog"
@@ -132,12 +133,15 @@ func findAPIs(client discovery.DiscoveryInterface) (*resourceMap, error) {

// The call to ServerGroups() prevents from calling ServerPreferredResources() when ServerGroups() returns nil
// (which will make ServerPreferredResources() panic)
originalErrorHandlers := runtime.ErrorHandlers
runtime.ErrorHandlers = nil
groups, err := client.ServerGroups()
if groups == nil {
resList = nil
} else {
resList, err = client.ServerPreferredResources()
}
runtime.ErrorHandlers = originalErrorHandlers

if err != nil {
return nil, fmt.Errorf("failed to fetch api groups from kubernetes: %w", err)