Documentation
¶
Index ¶
- func GetInsightsInfoFunction(insightsInfo *InsightsInfo) func(rego.BuiltinContext, *ast.Term) (*ast.Term, error)
- func GetRegoQuery(body string, regoVersion *string, dataFn KubeDataFunction, ...) *rego.Rego
- func RunRegoForItem(ctx context.Context, regoStr string, regoVersion *string, ...) ([]interface{}, error)
- func RunRegoForItemV2(ctx context.Context, regoStr string, regoVersion *string, ...) ([]interface{}, error)
- type InsightsInfo
- type KubeDataFunction
- type NilDataFunction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInsightsInfoFunction ¶
func GetInsightsInfoFunction(insightsInfo *InsightsInfo) func(rego.BuiltinContext, *ast.Term) (*ast.Term, error)
GetInsightsInfoFunction returns a function that is called from a rego policy, to provide Insights information to the policy depending on the function parameter.
func GetRegoQuery ¶
func GetRegoQuery(body string, regoVersion *string, dataFn KubeDataFunction, opaCustomLibs map[string]string, insightsInfo *InsightsInfo) *rego.Rego
func RunRegoForItem ¶
func RunRegoForItem(ctx context.Context, regoStr string, regoVersion *string, params map[string]interface{}, obj map[string]interface{}, dataFn KubeDataFunction, insightsInfo *InsightsInfo) ([]interface{}, error)
func RunRegoForItemV2 ¶
func RunRegoForItemV2(ctx context.Context, regoStr string, regoVersion *string, obj map[string]interface{}, dataFn KubeDataFunction, opaCustomLibs map[string]string, insightsInfo *InsightsInfo) ([]interface{}, error)
func RunRegoForItemV2 evaluates rego against a Kube object. IT replaces RunRegoForItemV() and supports v2 of Insights OPACustomChecks.
Types ¶
type InsightsInfo ¶
type InsightsInfo struct { InsightsContext string Cluster string Repository string AdmissionRequest *admission.Request }
InsightsInfo exposes Insights perspective, for consideration in rego policies. FOr example, the context rego has been executed - Continuous Integration, Admission Controller, or the Insights Agent.
type KubeDataFunction ¶
type NilDataFunction ¶
type NilDataFunction struct{}
Click to show internal directories.
Click to hide internal directories.