plan

package
v0.19.1306 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2026 License: AGPL-3.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 stream 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"`
	// Operation is the plan operation: CREATE, UPDATE or DELETE. Omitted when unknown.
	Operation string                 `json:"operation,omitempty"`
	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

type TerraformPlan struct {
	Plan tfjson.Plan `json:"plan"`
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL