framework

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout = 3 * time.Minute
	DefaultPolling = 2 * time.Second
)

Variables

This section is empty.

Functions

func AssertAllPodsRunning

func AssertAllPodsRunning(g gomega.Gomega, kubeContext, namespace string)

AssertAllPodsRunning checks every non-completed pod in the namespace is Running. Designed for use inside Eventually(func(g Gomega) { ... }).

func AssertClusterResourceExists added in v1.0.0

func AssertClusterResourceExists(g gomega.Gomega, kubeContext, resource, name string)

AssertClusterResourceExists checks that a cluster-scoped resource exists. Designed for use inside Eventually(func(g Gomega) { ... }).

func AssertJsonpathEquals

func AssertJsonpathEquals(g gomega.Gomega, kubeContext, namespace, resource, name, jsonpath, expected string)

AssertJsonpathEquals checks that a jsonpath value on a resource matches the expected string. Designed for use inside Eventually(func(g Gomega) { ... }).

func AssertResourceExists

func AssertResourceExists(g gomega.Gomega, kubeContext, namespace, resource, name string)

AssertResourceExists checks that a named resource exists in the namespace. Designed for use inside Eventually(func(g Gomega) { ... }).

func GetDPNamespace added in v0.17.0

func GetDPNamespace(kubeContext, cpNamespace, project, environment string) (string, error)

GetDPNamespace discovers a data plane namespace by its control plane labels. DP namespace names include a hash suffix and cannot be predicted, so we query by label selectors instead.

func Kubectl

func Kubectl(kubeContext string, args ...string) (string, error)

Kubectl executes an arbitrary kubectl command with the given context. Returns trimmed combined output (stdout+stderr) and any error.

func KubectlApplyLiteral added in v0.17.0

func KubectlApplyLiteral(kubeContext, yamlContent string) (string, error)

KubectlApplyLiteral pipes yamlContent to: kubectl apply -f -

func KubectlDeleteLiteral added in v0.17.0

func KubectlDeleteLiteral(kubeContext, yamlContent string) (string, error)

KubectlDeleteLiteral pipes yamlContent to: kubectl delete --ignore-not-found -f -

func KubectlExec added in v0.17.0

func KubectlExec(kubeContext, namespace, pod, container string, command ...string) (string, error)

KubectlExec runs: kubectl exec <pod> -n <namespace> [-c <container>] -- <command...>

func KubectlExecByLabel added in v0.17.0

func KubectlExecByLabel(kubeContext, namespace, labelSelector, container string, command ...string) (string, error)

KubectlExecByLabel finds a Running pod by label selector and execs a command in it. This is useful for OC-managed pods whose names are generated by Deployments.

func KubectlGet

func KubectlGet(kubeContext, namespace, resource string, extraArgs ...string) (string, error)

KubectlGet runs: kubectl get <resource> -n <namespace> [extraArgs...]

func KubectlGetJsonpath

func KubectlGetJsonpath(kubeContext, namespace, resource, name, jsonpath string) (string, error)

KubectlGetJsonpath runs: kubectl get <resource> <name> -n <namespace> -o jsonpath=<expr>

func KubectlLogs

func KubectlLogs(kubeContext, namespace, labelSelector string, tail int) (string, error)

KubectlLogs runs: kubectl logs -n <namespace> -l <labelSelector> --tail=<tail>

func KubectlRolloutRestart added in v0.17.0

func KubectlRolloutRestart(kubeContext, namespace, resource string) error

KubectlRolloutRestart runs: kubectl rollout restart <resource> -n <namespace> and then waits for the rollout to complete.

Types

type PodStatus

type PodStatus struct {
	Name     string
	Phase    string
	Restarts string
}

PodStatus holds parsed pod information.

func GetPodStatuses

func GetPodStatuses(kubeContext, namespace string) ([]PodStatus, error)

GetPodStatuses returns the status of all non-completed pods in a namespace. Completed pods (Succeeded/Failed) are filtered out via field-selector so Job pods like the CA-extractor don't cause false failures.

Jump to

Keyboard shortcuts

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