failurehandler

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

package failurehandler provides functions to help with extra debugging when Gomega assertions fail

Example using Gomega's `Eventually`

Eventually(wait.IsAllAppDeployed(state.GetContext(), state.GetFramework().MC(), appNamespacedNames)).
		WithTimeout(timeout).
		WithPolling(10*time.Second).
		Should(
			BeTrue(),
			failurehandler.AppIssues(state.GetContext(), state.GetFramework(), state.GetCluster()),
		)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailureHandler

type FailureHandler interface{}

FailureHandler is a function that can be used with Gomega to perform extra debugging when an assertion fails Note: Needs to be `interface{}` for Gomega to accept this alias type

func AppIssues

func AppIssues(framework *clustertest.Framework, cluster *application.Cluster) FailureHandler

AppIssues produces debugging information from app-operator (on the MC) and chart-operator (on the WC) This function will log out the status of the deployments, any related Events found and the last 25 lines of logs from the pods.

func Bundle

func Bundle(failureHandlers ...FailureHandler) FailureHandler

Bundle allows multiple different FailureHandler functions to be used in a chain

func DaemonSetsNotReady

func DaemonSetsNotReady(framework *clustertest.Framework, cluster *application.Cluster) FailureHandler

DaemonSetsNotReady collects debug information for all DaemonSets in the workload cluster that currently don't have the expected number of replicas. This information includes events for the DaemonSets and the status of any associated pods.

func DeploymentsNotReady

func DeploymentsNotReady(framework *clustertest.Framework, cluster *application.Cluster) FailureHandler

DeploymentsNotReady collects debug information for all deployments in the workload cluster that currently don't have the expected number of replicas. This information includes events for the deployment and the status of any associated pods.

func HelmReleasesNotReady

func HelmReleasesNotReady(framework *clustertest.Framework, cluster *application.Cluster) FailureHandler

HelmReleasesNotReady collects debug information for all HelmReleases in the organization namespace in the management cluster that currently are not ready.

func JobsUnsuccessful

func JobsUnsuccessful(framework *clustertest.Framework, cluster *application.Cluster) FailureHandler

JobsUnsuccessful collects debug information for all Jobs in the workload cluster that haven't completed successfully. This information includes events for the Jobs and the status of all their conditions

func LLMPrompt added in v2.2.0

func LLMPrompt(framework *clustertest.Framework, cluster *application.Cluster, query string) FailureHandler

LLMPrompt creates a Kubernetes Job that uses an LLM to investigate issues in the cluster. The Job runs with a timeout and is automatically cleaned up after completion via Kubernetes TTL controller. The query parameter specifies what the LLM should investigate.

Example usage:

failurehandler.LLMPrompt(framework, cluster, "Investigate why the HelmReleases are not Ready")
failurehandler.LLMPrompt(framework, cluster, "Investigate why the Apps are not Ready")
failurehandler.LLMPrompt(framework, cluster, "Investigate pods with several restarts")

func PodsNotReady

func PodsNotReady(framework *clustertest.Framework, cluster *application.Cluster) FailureHandler

PodsNotReady collects debug information for all pods in the workload cluster that currently aren't reporting as ready or completed. This information includes events and conditions for the pod and the latest log lines.

func StatefulSetsNotReady

func StatefulSetsNotReady(framework *clustertest.Framework, cluster *application.Cluster) FailureHandler

StatefulSetsNotReady collects debug information for all StatefulSets in the workload cluster that currently don't have the expected number of replicas. This information includes events for the StatefulSet and the status of any associated pods.

func Wrap

func Wrap(fn func()) FailureHandler

Wrap returns a valid FailureHandler for the given function

Jump to

Keyboard shortcuts

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