Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentContext ¶
GetCurrentContext returns the current Kubernetes context and cluster name
func RunKubectlCommand ¶
RunKubectlCommand executes a kubectl command and returns the output
Types ¶
type CommandExecutor ¶
CommandExecutor defines how we run commands
var Executor CommandExecutor = RealExecutor{}
Executor is the variable we use to run commands.
type SimplePolicy ¶
type SimplePolicy struct {
Name string
ValidationFailureAction string
Rules []SimpleRule
}
SimplePolicy matches the interface expected by the cmd package
func GetAllPolicies ¶
func GetAllPolicies() ([]SimplePolicy, error)
GetAllPolicies retrieves all Kyverno policies using kubectl
func GetPolicy ¶
func GetPolicy(name string) (*SimplePolicy, error)
GetPolicy retrieves a specific Kyverno policy by name using kubectl
type SimplePolicyReport ¶
type SimplePolicyReport struct {
Policy string
Namespace string
Resource string
Status string
Message string
}
SimplePolicyReport for CLI output
func GetAllPolicyReports ¶
func GetAllPolicyReports(filter string) ([]SimplePolicyReport, error)
GetAllPolicyReports retrieves all policy reports from the cluster
func GetPolicyResources ¶
func GetPolicyResources(policyName string) ([]SimplePolicyReport, error)
GetPolicyResources retrieves all resources affected by a specific policy
type SimpleRule ¶
type SimpleRule struct {
Name string
}
Click to show internal directories.
Click to hide internal directories.