Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdmissionReviewInput ¶
type AdmissionReviewInput struct {
Review AdmissionReviewRequest `json:"review"`
}
AdmissionReviewInput mimics Kubernetes AdmissionReview structure for OPA policy evaluation. This structure matches what existing OPA policies expect (e.g., input.review.object).
func ParseMultiDocYAMLToAdmissionReviews ¶
func ParseMultiDocYAMLToAdmissionReviews(multiDocYAML string) ([]AdmissionReviewInput, error)
ParseMultiDocYAMLToAdmissionReviews parses a multi-document YAML string (separated by ---) and converts each document into an AdmissionReviewInput structure suitable for OPA policy evaluation.
type AdmissionReviewKind ¶
type AdmissionReviewKind struct {
Kind string `json:"kind"`
Group string `json:"group,omitempty"`
Version string `json:"version,omitempty"`
}
AdmissionReviewKind contains the GVK (Group, Version, Kind) of the object.
type AdmissionReviewRequest ¶
type AdmissionReviewRequest struct {
Kind AdmissionReviewKind `json:"kind"`
Object map[string]interface{} `json:"object"`
}
AdmissionReviewRequest contains the object being reviewed and its kind information.
type KubernetesManifestPlanContents ¶
type KubernetesManifestPlanContents struct {
Plan string `json:"plan"`
Op KubernetesManifestPlanOperation `json:"op"`
ContentDiff []diff.ResourceDiff `json:"k8s_content_diff,omitempty"`
DryRunOutput string `json:"dry_run_output,omitempty"`
}
KubernetesManifestPlanContents for kubernetes plan, summarized before after state of all resources
type KubernetesManifestPlanOperation ¶
type KubernetesManifestPlanOperation string
const ( KubernetesManifestPlanOperationApply KubernetesManifestPlanOperation = "apply" KubernetesManifestPlanOperationDelete KubernetesManifestPlanOperation = "delete" )
type TerraformPlan ¶
TerraformPlan wraps the Terraform JSON plan in a format expected by OPA policies prevalent in the ecosystem.
func ParseTerraformPlan ¶
func ParseTerraformPlan(planJSON []byte) (*TerraformPlan, error)
ParseTerraformPlan parses the given Terraform plan JSON into a TerraformPlan structure.