Documentation
¶
Overview ¶
Package verifier evaluates scenario outcome quality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgoCDAppHealthyCheck ¶
type ArgoCDAppHealthyCheck struct {
Name string
}
ArgoCDAppHealthyCheck verifies an Argo CD application is healthy and synced.
func (*ArgoCDAppHealthyCheck) Check ¶
func (c *ArgoCDAppHealthyCheck) Check(ctx context.Context, kubeconfigPath string) CheckResult
Check runs argocd or kubectl to verify app health.
func (*ArgoCDAppHealthyCheck) Validate ¶
func (c *ArgoCDAppHealthyCheck) Validate() error
Validate checks that required fields are set.
type CheckDef ¶
CheckDef is the check definition accepted by BuildCheckers. It mirrors scenario.Check to avoid a package dependency cycle.
type CheckResult ¶
type CheckResult struct {
Name string `json:"name"`
Type string `json:"type"`
Verdict Verdict `json:"verdict"`
Message string `json:"message,omitempty"`
}
CheckResult holds the result of a single verification check.
type Checker ¶
type Checker interface {
Check(ctx context.Context, kubeconfigPath string) CheckResult
}
Checker runs a single verification check against the cluster.
func BuildCheckers ¶
BuildCheckers creates Checker instances from check definitions.
type CommandSucceedsCheck ¶
CommandSucceedsCheck runs a script and passes if it exits 0.
func (*CommandSucceedsCheck) Check ¶
func (c *CommandSucceedsCheck) Check(ctx context.Context, kubeconfigPath string) CheckResult
Check runs the command and returns pass if it exits 0.
func (*CommandSucceedsCheck) Validate ¶
func (c *CommandSucceedsCheck) Validate() error
Validate checks that required fields are set.
type DeploymentReadyCheck ¶
DeploymentReadyCheck verifies a deployment has all replicas ready.
func (*DeploymentReadyCheck) Check ¶
func (c *DeploymentReadyCheck) Check(ctx context.Context, kubeconfigPath string) CheckResult
Check runs kubectl to verify the deployment is ready.
func (*DeploymentReadyCheck) Validate ¶
func (c *DeploymentReadyCheck) Validate() error
Validate checks that required fields are set.
type HelmReleaseCheck ¶
HelmReleaseCheck verifies a Helm release is deployed.
func (*HelmReleaseCheck) Check ¶
func (c *HelmReleaseCheck) Check(ctx context.Context, kubeconfigPath string) CheckResult
Check runs helm to verify the release exists and is deployed.
func (*HelmReleaseCheck) Validate ¶
func (c *HelmReleaseCheck) Validate() error
Validate checks that required fields are set.
type ResourceExistsCheck ¶
type ResourceExistsCheck struct {
Namespace string
Name string
Kind string // e.g. "NetworkPolicy", "PodDisruptionBudget"
}
ResourceExistsCheck verifies a specific Kubernetes resource still exists.
func (*ResourceExistsCheck) Check ¶
func (c *ResourceExistsCheck) Check(ctx context.Context, kubeconfigPath string) CheckResult
Check runs kubectl to verify the resource exists.
func (*ResourceExistsCheck) Validate ¶
func (c *ResourceExistsCheck) Validate() error
Validate checks that required fields are set.
type ServiceEndpointsCheck ¶
ServiceEndpointsCheck verifies a service has at least one endpoint.
func (*ServiceEndpointsCheck) Check ¶
func (c *ServiceEndpointsCheck) Check(ctx context.Context, kubeconfigPath string) CheckResult
Check runs kubectl to verify the service has endpoints.
func (*ServiceEndpointsCheck) Validate ¶
func (c *ServiceEndpointsCheck) Validate() error
Validate checks that required fields are set.
type ServiceReachableCheck ¶
ServiceReachableCheck verifies a service is reachable from a probe pod inside the cluster.
func (*ServiceReachableCheck) Check ¶
func (c *ServiceReachableCheck) Check(ctx context.Context, kubeconfigPath string) CheckResult
Check runs kubectl exec from the probe pod and verifies an HTTP request succeeds.
func (*ServiceReachableCheck) Validate ¶
func (c *ServiceReachableCheck) Validate() error
Validate checks that required fields are set.
type VerifyResult ¶
type VerifyResult struct {
Passed bool `json:"passed"`
Checks []CheckResult `json:"checks"`
}
VerifyResult holds the aggregate verification result.
func PollChecks ¶
func PollChecks(ctx context.Context, kubeconfigPath string, checkers []Checker, interval time.Duration) *VerifyResult
PollChecks runs all checkers in a loop until all pass or the context is cancelled. It polls at the given interval. Returns the last VerifyResult.