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

Function DetectSecurityContextConstraints

pkg/utils/discovery.go:139–146  ·  view source on GitHub ↗

DetectSecurityContextConstraints connects to the discovery API and find out if we're running under a system that implements OpenShift Security Context Constraints

(client discovery.DiscoveryInterface)

Source from the content-addressed store, hash-verified

137// DetectSecurityContextConstraints connects to the discovery API and find out if
138// we're running under a system that implements OpenShift Security Context Constraints
139func DetectSecurityContextConstraints(client discovery.DiscoveryInterface) (err error) {
140 haveSCC, err = resourceExist(client, "security.openshift.io/v1", "securitycontextconstraints")
141 if err != nil {
142 return err
143 }
144
145 return nil
146}
147
148// HaveSecurityContextConstraints returns true if we're running under a system that implements
149// OpenShift Security Context Constraints

Callers 4

SetupKubernetesClientFunction · 0.92
RunControllerFunction · 0.92
NewTestingEnvironmentFunction · 0.92
discovery_test.goFile · 0.85

Calls 1

resourceExistFunction · 0.85

Tested by

no test coverage detected