Documentation
¶
Overview ¶
Package sonobuoytest runs Kubernetes conformance, Sonobuoy's quick mode, for gcpemu's own tests: the Autopilot acceptance (e2e) on Autopilot clusters and TestKubeConformance (compat) on Standard clusters.
Only the e2e plugin runs, on Standard and Autopilot clusters alike: the systemd-logs plugin's DaemonSet is privileged and mounts host paths, which Autopilot refuses, as GKE does, and on a Standard cluster it only gathers node journals, asserting nothing about conformance (#754).
Index ¶
Constants ¶
const Version = "0.57.5"
Version is the pinned Sonobuoy release.
Variables ¶
var SHA256 = map[string]string{
"linux/amd64": "7c5c2250e5103c98f4dad2bcab86baf954e319c57c419c113f28f5060e62f129",
"linux/arm64": "ec482b5d1ec237f4c94b6fd7be5a69f95678a4331001b3edcb6ad7835ec40695",
"darwin/amd64": "4202d3a960a812e68b555829eefbe0cc25de8b2e5cb2fc8e5cc38dfc83515a9d",
"darwin/arm64": "d889c4a4485f3899f8d860506ed4da5380372f23f91cd0113e52f036d842e978",
"windows/amd64": "041500d35af9720cb8e0ec3584b32243e6555c1e7413caadf9ddb8c336354f63",
}
SHA256 is Version's archive checksums (sonobuoy_<version>_checksums.txt) by GOOS/GOARCH.
Functions ¶
Types ¶
type Guarded ¶
type Guarded struct {
Bin string // sonobuoy
Env []string // its environment, before the guard's
Guard *escapeguard.Guard
// APIServer is the cluster's API server ("https://10.0.0.2:6443" or
// "10.0.0.2"), on this machine, which the guard lets through.
APIServer string
}
Guarded runs sonobuoy behind the Escape guard (see CONTEXT.md), so that a request it sends off the machine is refused and named.
func (Guarded) Canary ¶
Canary asks for the server version of a cluster at canaryHost, writing its kubeconfig in dir, and returns an error unless the guard refuses the request. Without it, a sonobuoy that ignored HTTPS_PROXY would pass every run with the guard never seeing a request.
func (Guarded) Sonobuoy ¶
func (g Guarded) Sonobuoy(errorf func(format string, args ...any)) func(time.Duration, ...string) (string, error)
Sonobuoy is exec as Quick.Sonobuoy, calling errorf for each request the guard refused. gke-gcloud-auth-plugin, in a kubeconfig from gcloud, runs gcloud under it, so gcloud's universe descriptor fetch is not an escape.
type Quick ¶
type Quick struct {
// Sonobuoy runs sonobuoy with args against the cluster, within timeout.
Sonobuoy func(timeout time.Duration, args ...string) (string, error)
// Keep, if set, is the file a failed run's results tarball is copied to.
Keep string
// Diagnose, if set, explains a run that failed or left no results (the
// sonobuoy pods' logs, say).
Diagnose func() string
// Logf logs the results.
Logf func(format string, args ...any)
}
Quick is a quick-mode run against one cluster.