(client discovery.DiscoveryInterface, groupVersion, kind string)
| 116 | } |
| 117 | |
| 118 | func resourceExist(client discovery.DiscoveryInterface, groupVersion, kind string) (bool, error) { |
| 119 | apiResourceList, err := client.ServerResourcesForGroupVersion(groupVersion) |
| 120 | if err != nil { |
| 121 | if apierrors.IsNotFound(err) { |
| 122 | return false, nil |
| 123 | } |
| 124 | |
| 125 | return false, err |
| 126 | } |
| 127 | |
| 128 | for _, resource := range apiResourceList.APIResources { |
| 129 | if resource.Name == kind { |
| 130 | return true, nil |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | return false, nil |
| 135 | } |
| 136 | |
| 137 | // DetectSecurityContextConstraints connects to the discovery API and find out if |
| 138 | // we're running under a system that implements OpenShift Security Context Constraints |
no outgoing calls
no test coverage detected