GetDiscoveryClient creates a discovery client or return error
()
| 102 | |
| 103 | // GetDiscoveryClient creates a discovery client or return error |
| 104 | func 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 | |
| 118 | func resourceExist(client discovery.DiscoveryInterface, groupVersion, kind string) (bool, error) { |
| 119 | apiResourceList, err := client.ServerResourcesForGroupVersion(groupVersion) |
no test coverage detected