Documentation
¶
Index ¶
- Constants
- func AssertAllPodsRunning(g gomega.Gomega, kubeContext, namespace string)
- func AssertClusterResourceExists(g gomega.Gomega, kubeContext, resource, name string)
- func AssertJsonpathEquals(g gomega.Gomega, ...)
- func AssertResourceExists(g gomega.Gomega, kubeContext, namespace, resource, name string)
- func GetDPNamespace(kubeContext, cpNamespace, project, environment string) (string, error)
- func Kubectl(kubeContext string, args ...string) (string, error)
- func KubectlApplyLiteral(kubeContext, yamlContent string) (string, error)
- func KubectlDeleteLiteral(kubeContext, yamlContent string) (string, error)
- func KubectlExec(kubeContext, namespace, pod, container string, command ...string) (string, error)
- func KubectlExecByLabel(kubeContext, namespace, labelSelector, container string, command ...string) (string, error)
- func KubectlGet(kubeContext, namespace, resource string, extraArgs ...string) (string, error)
- func KubectlGetJsonpath(kubeContext, namespace, resource, name, jsonpath string) (string, error)
- func KubectlLogs(kubeContext, namespace, labelSelector string, tail int) (string, error)
- func KubectlRolloutRestart(kubeContext, namespace, resource string) error
- type PodStatus
Constants ¶
const ( DefaultTimeout = 3 * time.Minute DefaultPolling = 2 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func AssertAllPodsRunning ¶
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
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 ¶
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
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 ¶
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
KubectlApplyLiteral pipes yamlContent to: kubectl apply -f -
func KubectlDeleteLiteral ¶ added in v0.17.0
KubectlDeleteLiteral pipes yamlContent to: kubectl delete --ignore-not-found -f -
func KubectlExec ¶ added in v0.17.0
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 ¶
KubectlGet runs: kubectl get <resource> -n <namespace> [extraArgs...]
func KubectlGetJsonpath ¶
KubectlGetJsonpath runs: kubectl get <resource> <name> -n <namespace> -o jsonpath=<expr>
func KubectlLogs ¶
KubectlLogs runs: kubectl logs -n <namespace> -l <labelSelector> --tail=<tail>
func KubectlRolloutRestart ¶ added in v0.17.0
KubectlRolloutRestart runs: kubectl rollout restart <resource> -n <namespace> and then waits for the rollout to complete.
Types ¶
type PodStatus ¶
PodStatus holds parsed pod information.
func GetPodStatuses ¶
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.