MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / GetDiscoveryClient

Function GetDiscoveryClient

pkg/utils/discovery.go:104–116  ·  view source on GitHub ↗

GetDiscoveryClient creates a discovery client or return error

()

Source from the content-addressed store, hash-verified

102
103// GetDiscoveryClient creates a discovery client or return error
104func GetDiscoveryClient() (*discovery.DiscoveryClient, error) {
105 config, err := ctrl.GetConfig()
106 if err != nil {
107 return nil, err
108 }
109
110 discoveryClient, err := discovery.NewDiscoveryClientForConfig(config)
111 if err != nil {
112 return nil, err
113 }
114
115 return discoveryClient, nil
116}
117
118func resourceExist(client discovery.DiscoveryInterface, groupVersion, kind string) (bool, error) {
119 apiResourceList, err := client.ServerResourcesForGroupVersion(groupVersion)

Callers 3

tryGetOLMReportFunction · 0.92
RunControllerFunction · 0.92
NewTestingEnvironmentFunction · 0.92

Calls 1

GetConfigMethod · 0.80

Tested by

no test coverage detected