MCPcopy
hub / github.com/open-policy-agent/gatekeeper / AddConstraint

Method AddConstraint

pkg/gator/client.go:22–22  ·  view source on GitHub ↗

AddConstraint adds a Constraint to the Client. Must map to one of the previously-added Templates. Returns an error if the referenced Template does not exist, or the Constraint does not match the structure defined by the referenced Template.

(ctx context.Context, constraint *unstructured.Unstructured)

Source from the content-addressed store, hash-verified

20 // Returns an error if the referenced Template does not exist, or the
21 // Constraint does not match the structure defined by the referenced Template.
22 AddConstraint(ctx context.Context, constraint *unstructured.Unstructured) (*types.Responses, error)
23
24 // AddData adds the state of the cluster. For use in referential Constraints.
25 AddData(ctx context.Context, data interface{}) (*types.Responses, error)

Callers 10

Test_auditFromCacheFunction · 0.95
TestFunction · 0.95
cacheConstraintMethod · 0.65
tryAddConstraintMethod · 0.65
addConstraintMethod · 0.65
runBenchmarkFunction · 0.65
TestReviewDefaultNSFunction · 0.65
TestExcludedNamespacesFunction · 0.65
TestTracingFunction · 0.65
addConstraintsFunction · 0.65

Calls

no outgoing calls

Tested by 6

Test_auditFromCacheFunction · 0.76
TestFunction · 0.76
TestReviewDefaultNSFunction · 0.52
TestExcludedNamespacesFunction · 0.52
TestTracingFunction · 0.52
addConstraintsFunction · 0.52